Custom attribute matching in Salesforce
Last Update: Oct 2024 • Est. Read Time: 3 MINThe Kustomer and Salesforce integration offers an advanced setup method that extends the app's functionality through customizing the case sync workflow. This article will describe how to modify the workflow to customize payloads sent to Salesforce, allowing the option of custom attribute matching from your Salesforce data.
Who can access this feature?
- Available to Salesforce plans that include API access: Enterprise Edition, Professional Edition with API access, Unlimited Edition, and Performance Edition.
In this article
- Prerequisites
- Duplicate the case sync workflow
- Customize the workflow
- Workflow payloads
- Save and activate the workflow
Prerequisites
You'll need to finish all the setup steps in Integrate with Salesforce and Create cases in Salesforce before this advanced configuration can be set up.
You will also need to be familiar with the basics of using Workflow automations in Kustomer to make the changes outlined in this article. Learn more about this concept in Workflows Overview.
Duplicate the case sync workflow
App-installed workflows cannot be directly customized, so to make the required changes to this workflow, you'll need to begin by creating a copy of the Salesforce workflow.
To duplicate the Salesforce workflow:
- In Kustomer, go to Settings > Platform > Workflows.
- Select the App Created tab.
- Use the search field or scroll down in the list to locate the salesforce-case-syncworkflow.
Note: If you plan to immediately activate the new custom workflow, now would be a good time to turn the original workflow off by using the toggle. Otherwise, make a note to return here later to deactivate the original workflow when you're ready to go live.
- Select the menu icon, then select Duplicate.
You'll see a Workflow created notification in the bottom corner of the screen to indicate this was successful. You should now be able to locate your custom workflow in the User Created tab under the name copy-salesforce-case-sync
. That's probably not a very memorable name, so we'll update it in the next step.
Customize the workflow
Next, you'll modify the workflow to allow for custom attribute matching.
To update the custom workflow:
- In the Workflows Settings, switch to the User Created tab. Locate the
copy-salesforce-case-sync
workflow, and select the Editicon to its right. - The Workflow Editor will open. Start by selecting the Moremenu icon in the toolbar, then select Edit Info.
- In the Edit Workflow Info panel, update the name and description as you prefer, then press Save.
Note: We always recommend as a best practice that you use clear and illustrative names and descriptions, so that it's easy to know what function this automation performs if another member of your team reviews this workflow at a later date.
- Scroll to the bottom of the workflow. After the last action, add a new action step with the following properties:
- Action Information
- Action Title: Command Run By Name
- Action Description: (optional)
- Action App: Kustomer
- Action Event: Command Run By Name
- Required fields
- Name (string):
kustomer_salesforce.app.kustomer.kustomer_salesforce.commands.upsert-with-external-id
- Name (string):
- Optional Fields
- Action Information
The result will look something like this:
Before you can save and activate the workflow, you'll need to fill in the payloads as specified in the next section.
Workflow payloads
The Body and UrlArgs fields in the workflow are where you'll provide a payload for your custom attribute matching.
Body
This is the payload that you want to send on the request to Salesforce. The general format of this payload will be as follows:
{ “SalesforceCustomAttribute1”: “TargetKustomerValue1” “SalesforceCustomAttribute2”: “TargetKustomerValue2” “SalesforceCustomAttribute3”: “TargetKustomerValue3” }
One potential example for how this might be used is the following payload, which syncs over certain fields that are manually assigned to conversations:
{ "Kustomer_Conversation_App_and_Resolution__c": "{{steps.1.custom.appResolutionStr}}", "Kustomer_Conversation_Business_Impact__c": "{{steps.1.custom.businessImpactStr}}", "Kustomer_Conversation_Contact_Reason__c": "{{steps.1.custom.cxContactReasonTree}}", "Kustomer_Conversation_Effort_to_resolve__c": "/#fn:parseInt,steps.1.custom.effortNum", "Kustomer_Conversation_Escalated__c": "{{steps.1.custom.escalatedBool}}", "Kustomer_Conversation_Jira_Issue__c": "{{steps.1.custom.jiraIssueStr}}" }
UrlArgs
These are the arguments that are used to construct the URL to which the request is made. Here's an example:
{ "version": "v42.0", "sobject": "Case", "externalIdAttribute": "KustomerApp__Conversation_ID__c", "externalId": "/#steps.1.id" }
version
: whichever version of the Salesforce API you choose to usesobject
: the type of object you are modifyingexternalIdAttribute
: the name of the external identifier that exists on thesobject
externalId
: the value of theexternalIdAttribute
. In the above example, it is the Kustomer conversation ID.
Save and activate the workflow
After setting up your payloads, you can modify any other aspects of the Attribute Matching workflow as you need. When you're all finished, select the Save button in the toolbar above the editor to commit your changes.
When you're ready to activate the workflow, you can turn it on by using the toggle at the top of the workflow editor, or in the list of workflows.
Note: Remember to turn off the original salesforce-case-sync app-installed workflow, if you didn't already do so earlier. Running multiple versions of the workflow simultaneously can cause errors or unpredictable results.
When the workflow command is run, it will perform a request to the following URL:
https://your-salesforce-subdomain.salesforce.com/services/data/:version/sobjects/:sobject/:externalIdAttribute/:externalId
Using the examples outlined in this article, the URL would be:
https://your-salesforce-subdomain.salesforce.com/services/data/v42.0/sobjects/Case/KustomerApp__Conversation_ID__c/6140cefd91ffddd18144e08b