Mapping your data by inserting references
When you add an action to your flow, you need to specify data for any required target fields for the action (or invoked API operation) to be performed. You can map data from preceding nodes in the flow by inserting references to source fields in those nodes.
In each field of an action (or invoked API operation), you can add a reference to source fields in preceding nodes in the flow to have the value of those fields passed to a target application.
In the following example, an action has an Email Address field. A reference has been inserted to an Email field of a preceding node in the flow. When the flow runs, it adds Jane Doe@email.com to the required target field Email Address if the value of the source field Email is Jane Doe@email.com (the source application must pass such a valid email address).
To add a reference to a source field, click in the target field. This displays the Insert a mapping icon next to the field.
- If you start typing the name of a source field (like
email
) and then pause briefly, App Connect offers you choices for fields based on what you are typing. Alternatively, you can click the Insert a mapping icon to see the full choice of fields that you can insert. - You can select fields from the event or from previous target applications in the flow. For example:
In each required field for the target application, ensure that you provide a value as needed by the target application. If you map the name of a source field, you should ensure that the source application will pass a suitable value; otherwise, if a value passed is invalid the flow can't complete successfully. In your flow, you can use conditional logic to do something appropriate if a value passed is invalid.
Behavior of mappings that evaluate to null or undefined in fields of type string or date-time
Depending on your source data, it is possible for the source mapping in a target field of type
string
() or date-time
() to evaluate
to a null or undefined value (equivalent to having no value) when a flow runs. If this happens, the
null or undefined input value is retained and reflected in the resulting output when the mapping is
evaluated.
For example, consider a Salesforce Create lead action, which creates a lead by using contact details from another system. In the First Name target field for this Salesforce action, a mapping is inserted to set the new lead's first name to the contact's first name.
If the inserted First Name mapping evaluates to null or undefined at runtime, the null or undefined value is honored as the input for First Name and is reflected in the output. The following examples depict "null" and "undefined" inputs for a First Name field (together with valid Last Name and Company inputs), and the respective outputs when the Try this action feature is applied to the Salesforce Create lead action. Each output in this example also includes the lead ID, which Salesforce generates whenever a lead is created.
Input | Output |
---|---|
First Name = |
|
First Name = |
|
- The if condition for an If node
- The filter condition for any Retrieve, Update, Update or create, Delete, or Batch process action