findOrCreate.map

Use the findOrCreate.map method to search for or create records that contain specific customer details.

Usage 

Searches for or creates records that contain customer data specified by the addCustomDetail Deployment API method. This method maps the value of the custom details to the fields on the specified record in the Salesforce console.

You can call the findOrCreate.map method as many times as necessary to find the appropriate records. Call the method once for every field and its corresponding custom detail value you want to search for.

Implement the findOrCreate.map call in an agent session and not a bot session. If findOrCreate.map matches multiple records, the agent can choose which record to attach but the bot doesn’t have a way of doing that.

Available in API versions 29.0 and later.

Syntax 

liveagent.findOrCreate(Object EntityName).map(String FieldName, String DetailName, Boolean doFind, Boolean isExactMatch, Boolean doCreate)

Parameters 

NameTypeDescriptionAvailable Versions
FieldNameStringThe API name of the field in the record EntityNameto which to map the corresponding custom detail DetailName.Available in API versions 29.0 and later.
DetailNameStringThe value of the custom detail to map to the corresponding field FieldName.Available in API versions 29.0 and later.
doFindBooleanSpecifies whether to search for a record that contains the custom detail DetailName in the field FieldName (true) or not (false).Available in API versions 29.0 and later.
isExactMatchBooleanSpecifies whether to search for a record that contains the exact value of the custom detail DetailName you specified in the field FieldName (true) or not (false).Available in API versions 29.0 and later.
doCreateBooleanSpecifies whether to create a new record with the custom detail DetailName in the field FieldName if one isn’t found (true) or not (false).Available in API versions 29.0 and later.