Conditional mapping in Salesforce Push

Last updated Feb 08 2019

Conditions in Push
When you Set a push integration with Salesforce you can do so with conditions:

- Action condition -  when you choose “Update” or “Find” you will be required to specify a condition when this action will be carried out.
- Rule condition - will enable you to  set a condition to specify when the push will occur.
But what if you want your field mapping to be conditioned? Can you do that?
Well, yes you can.

Conditions in Mapping
Let’s say you want to have 2 fields in your form mapped to the same field in Salesforce and use each one at different circumstances - you can use the condition in the mapping for that.

Example
In the following example we will create a new Account in Salesforce with the following details: account name, website and description.

The only catch is that we will provide 2 account name fields, and the one used by the filler will be the one registered in SF.
for this we will add a condition in our mapping, specifying that if field A is not empty - use it in the mapping, and if field B is not empty - use it instead.
Follow the steps to see how it’s done:

1- Create a new blank form
2- Drag 2 textboxes and change their label text.
Call the first: account name and the second: account name 2. Later on we will add a condition in the mapping where if one of them is filled - it will be used in the mapping.


3- Drag a url element and change its label text to: website.


4-

Drag a textarea element and change its label text to: description.


5-

Place the submit button at the bottom.
6- we will now configure the push integration to Salesforce:
- Go to: ‘Properties’ panel > ‘Form’ tab > ‘Settings’ option > ‘Salesforce integration’  > Push to Salesforce
- Press on ‘’ button


- Authenticate with Salesforce
- Choose object: Account


- Select an action: Create


- Map fields - press on ‘Map fields’ button
- Filter for “Account name” field in Salesforce, but instead of mapping it to one specific field in your form, choose “Conditional”.
- A “Configure” button will now appear - press on it


- Set the following rules:
Rule 1 : if account name 2 is not empty, then use value: account name 2
Rule 2 : if account name is not empty, then use value: account name

Please notice that you can also use the"Else" to make this condition shorter and more effective.  for example:
If account name is not empty - use value of account name
else
use value of account name 2



- Go ahead and map the rest of the fields as usual:

Website -- > Website
Account Description → description


- Press ‘Apply’
- You will see that a new integration line was created


- Press ‘Finish’ and save the form.

7-

Now check your form:
- Publish it as URL and test both options
First option:  Enter a name in the account name field, Enter a website and description
Second option:  Enter a different name in the account name 2 field, Enter a different website and different description


8-  Enter your Salesforce account and you will see that these 2 new accounts were created


   Read more on Salesforce forms
Watch the video:
 
 
CommentsLogin Required
Didn’t find what you were looking for?
Try the following for assistance or Use the Search box.