To create a new Target Lookup Query, navigate to the Lookup Queries tab click on New Query, then select the Type (Target) and the Search Form from the drop-down list. The options for Target Lookup Queries are slightly different. The value that you compare with can either be on the source or target server. To compare with a value on the target server, select the field from the Current Entry Value (Target) field. e.g.

To compare with a value on the source server click the checkbox ‘Use Current Source Values’. In this case, the Current Entry Value field changes to ‘Current Entry Value [Source]’ and the field value that you select is pre-fixed with ‘SRC.’ to indicate that it relates to a source field value. e.g.

In this example the field on the target server is compared with the current value of the Company field on the source server. The source and target servers can either be of the same type (e.g. ServiceNow), or different types, (e.g. ServiceNow and Salesforce).
You can also use temporary variables in the expression by selecting from Temporary Variable dropdown. Note that the temporary variable must have been defined previously before it can be used in an expression. For more information on how to create temporary variables, see article on Creating Temporary Variables.
Note that you cannot mix the use of source and target values in the same query expression. So for example the query:
[Company] = #SRC.Company# and [Company ID] = #Company ID#
would not be allowed because it references values from both source and target servers.
After you have finished entering your query, click the OK button to save it.
You can then use the Validate button to the right of the screen to check that the query entered is valid. Then click on the Apply button to save the Query or click on the Revert button to revert to the last saved version. After applying the Query, it will appear in the list of Lookup Queries in the top section like this:

To create another Lookup Query for this Form Mapping, use the New Query button, or to remove an existing Lookup Query from the list, use the Remove button.
Warning: You cannot remove a Lookup Query if it has been referenced in a Field Mapping. If you attempt to, a message to this effect will be displayed, highlighting the reference. You should remove the field mapping first before removing the Lookup Query.
To modify an existing Lookup Query, simply click on the corresponding row in the list of Lookup Queries, make the necessary changes using the fields in the bottom section (including Query Builder if required), then click on the Apply button to save your changes.
Null Parameter Action
If your query contains parameters (for instance current source/target fields or temporary variables) you an optionally choose how to handle queries that may get executed at execution time where one or more of the parameters is NULL. This can be useful for instance if it is often the case where a parameter is NULL and you always want to set the target value to NULL if this is the case. Note that this option will apply to ALL field mappings where the lookup query is used.
The options are as follows:
| Null Parameter Action | Description |
| Run Query | The query will be run anyway, with the NULL matching any NULL values in the lookup form's data. This is the default option. |
| Return NULL | The query will not be run, and the value returned from the lookup field mapping will always be NULL. This can prevent unexpected results where a null match occurs due to missing data on the lookup table. It also improves performance where the parameter is an optional field that does not always have a value, since it prevents queries being run o the server unnecessarily. |
| Return No Match | The query will not be run and the No Match Action for the field mapping will be followed (Set Null, Log Error, Set Default etc) |
| Ignore | The query will not be run. If a record is getting updated, any existing value for the field will not be changed. If a new record is being created, the value will be set to NULL, or a default value if the target server sets one automatically. |
Comments
0 comments
Please sign in to leave a comment.