Conditional Field Mapping
Conditional Field Mapping allows you to control whether or not a value or field is written to a target datastore based on the contents of the source data. For example, if there is a NULL value in a source field, you can choose to overwrite target data with the NULL value or skip that field when updating a record. Conditional Field Mapping options are set on the Block Properties Fields Tab for target operation Blocks.
When you click the Functional Condition icon to enable it, the Mapping Condition dialog is displayed. It is similar to the Formula Editor Overview, but is used specifically to enter a formula that resolves to a boolean. Using the formula below, if the value of Country received from the source is USA, this formula returns True and the data is written to the target database. If the value of Country is anything else, the formula returns False and no data is written to the target.
Option |
Definition |
---|---|
Skip Mapping If Null |
If this option is enabled for the block, when a mapped field or formula results in a NULL value, the NULL value is not written to the target. This applies to all mapped fields in the block. If all mapped fields result in NULL values, no updates are made and a record error similar to the following is generated: Operation returned no results - Error in calling operation update |
|
Skip Null Icon — Enables the Skip Null option for the field. If the field mapping results in a NULL value, the NULL is not written to the target field. |
|
Skip Null Enabled Icon — Indicates that the Skip Null option is enabled for this field. |
|
IsFieldSet Icon — Enables the ISFIELDSET function for this field. In some cases, when a Connector encounters a source field that has no value, it does not send the field at all. For example, if an address record were missing City, the Connector would send Street, State, Zipcode but would leave City out of the data set sent to the flow. Default behavior when a field is completely missing from the source and IsFieldSet is not enabled, is to write a NULL to the target database for that field. When IsFieldSet is enabled, if the field name is not included in the results from the source, nothing is written to the target for this field. If the field name is returned but has no associated value, it is written to the target as a blank or NULL. Note: This option can only be enabled for fields that are mapped with a field name. If the field contains a formula, this option cannot be selected. If a formula is entered after the option is set, a warning is displayed on the Errors and Warnings tab.
|
|
IsFieldSet Enabled Icon — Indicates that the IsFieldSet option is enabled for this field. |
|
Functional Condition Icon — Enables the Functional Condition option for this field and opens the Mapping Condition Editor where you can enter the associated formula. The formula must resolve to a boolean. If the formula resolves to true, the source value is written to the target. If the formula resolves to false, the source value is not written to the target. For example, if you enter the following:
IF(Source.City="Boston","False","True")
Using this formula, if the value of Source.City is Boston, the formula returns False and nothing is written to the target. If the value of the Source.City field is anything else, the formula returns True and the value of Source.City is written to the target. In this scenario, all cities except Boston would be written to the target.
If you enter the following:
IF(Source.City="Boston","True","False")
Using this formula, if the value of Source.City is Boston, the formula returns True and Boston is written to the target. If the value of the Source.City field is anything else, the formula returns False and the value of Source.City is not written to the target. In this scenario, only Boston would ever be written to the target. Note: The Mapping Condition dialog is very similar to the Formula Editor dialog. Make sure the title of the dialog says Mapping Condition. For information on using the fields on this dialog, see Formula Editor Overview.
|
|
Functional Condition Enabled Icon — Indicates that the Functional Condition option is enabled for this field. |
|
Clear Condition Icon — Clears any conditional settings on the selected field including: Skip Null IsFieldSet Functional Condition
Hover over the Condition Icon to display the Clear Icon. |
Additional Notes
- Empty fields do not display the Conditional mapping icons. Map a field to display the icons.
- If you enable a condition on a mapped field and later manually delete the mapping, the condition remains enabled on the field, but does not affect the flow.
- If you clear a mapped field using the Clear link at the top of the Target Pane, both the mapping and the condition are removed.
- If a condition is set on an empty field because you have deleted the mapping manually and you later remap that field, the condition is used when the flow runs.
Setting Conditional Mapping
- Open a flow.
- Select the appropriate block and select the Fields link from the Properties panel.
- In the Target pane of the Fields tab, map the source fields to the target fields.
- Hover over a mapped field and click the icon for the option you want to enable.
- To disable an option, hover over the field and click the Clear icon .