Tutorial V2.41 (Lightning)

  1. Home
  2. Docs
  3. Tutorial V2.41 (Lightning)
  4. 7. How to use mapping?
  5. How to use formulas in mapping?

How to use formulas in mapping?

This tutorial explains what formula is and why do we need it. It also describes about the generating of IStructure which is correlating with mapping.

1.  What is formula?

Formula is a complex mapping rules – for example a combination of source fields or a combination of functions and source fields mapped to one sObject field. we can do formula mapping using different function.

2. Prerequisite

Before using formula in mapping, you must have an interface. To create, delete and edit interface, you need to do in Salesforce. This document is skipping the part where to create Integration and Interface. If you want to know how to create them, please look for document (SKYVVA Integration/ Interface).

3 The creation of IStructure

There are 5 ways to generate IStructure:
– Generate from sObject in field
– Manually created
– Upload from File
– Generate from Message Type
– Generate from SOQL Query (Outbound)

Description:
1. Generate from sObject in field: The Structure is generated from Source/Target of Salesforce object. In   case you don’t have your own Structure, we create this type of Istructure to make thing easier for you.
2. Manually created: You create IStructure field one by one by yourself.
3. Upload from File: You have your own source (Structure) and upload to Salesforce. The source is a file: CSV and XML.
4. Generate from Message Type: Upload IStructure in Repository then create Message type from it.
5. Generate from SOQL Query: To filter for fields of Salesforce object.

Note: There are 4 ways to generate IStructure for Inbound and 5 ways for Outbound Interface.

4. Inbound Mapping

For inbound interface the Mapping screen is like the screenshot below. The screen divided to two which are Source and Target. On the Source side, the fields structure is from external source weather Target side contains the fields structure from Salesforce object.

5. Outbound Mapping

As you can see the screen below, this is an outbound interface. The screen divided to two as inbound interface, however, the Source side here are containing the fields structure of Salesforce sObject and the Target side contains the fields of external source.

6. Using formula in mapping

This Istructure is generated from upload File. This part is explained about mapping in Salesforce using formula. There are lots of different formula you can choose to do in mapping, however, there are two formula which will be explained here in this document. These formular are VLOOKUP and IF. The following examples will demonstrate you how to use each formula in mapping

Mapping In Account Interface:

 

Mapping In Contact Interface:

6.1 VLOOKUP Formula

VLOOKUP is one of SKYVVA formula function which is better than the function of Salesforce that can retrieve the value from both standard and custom objects, different fields, e.g. Id and Name etc. with many conditions. To add any formula in mapping, you have to check on Formula box at the right as in the picture below and choose any kinds of function.

Here is the syntax of VLOOKUP:
“VLOOKUP(Standard/CustomObjectName,FieldToRetrieve,FieldCondition1,Condition1,Fiel dCondition2,Condition2,…)”
The popup window below will show when you check the flag and click on the line.
– Choose function = VLOOKUP then click Insert Select Function button
– Enter the values
– Clicks on Test Formula to see an output if it is true or failed than Save.

Note: If the output is failed, it means that your formula is incorrect.
In conclusion, after you map all fields, do the formula and choose the External ID, please Save. Just in case that you forget to save, all your Data Mapping will be lost.

6.2. IF Formula

IF is also one of formula to use in mapping. IF function is using to test for or evaluate certain conditions, and then react differently depending on whether the test was TRUE or FALSE. The IF function can perform a logical test and return one value for a TRUE result, and another for a FALSE result. You can use it to test for specific condition or more than one.
Here is the syntax:
IF(logical_test, value_if_true, value_if_false)
This section will only focus on how to use formula, so the steps will show at Data Mapping Editor where you have to check flag on Formula box and click the line in order to get the popup window.

– Choose function = IF then click Insert Select Function button

– Enter the values

– Clicks on Test Formula to see an output if it is true or failed than Save.

Note: If the output is failed, it means that your formula is incorrect.
In conclusion, after you map all fields, do the formula and choose the External ID, please Save. Just in case that you forget to save, all your Data Mapping will be lost.

 

Was this article helpful to you? Yes No

How can we help?