This article explains how to use the lookup handlebar at the record level to implement static and dynamic lookups in an HTTP application import.
This lookup option occurs during import mapping, in order to perform an additional query prior to syncing records. Do not confuse this import setting with the lookup flow step, which retrieves additional records or files within your flow.
Understand lookups
If the data available in your source application is insufficient or incomplete for the purposes of your integration, but the required information can be retrieved from a secondary source, you can use a lookup to supplement source application’s export data. You can use static and dynamic lookups at the record level for an HTTP import of JSON and XML media types. For more information, see Lookup field mapping.
Note: You must be familiar with the expected JSON or XML request body template for the HTTP import.
Create a dynamic lookup
- Click the mappings icon on the import step. The Edit mapping window opens.
- Click the gear icon next to the field you are mapping. The Settings window opens.
- In the Field mapping type section, click Lookup.
- Select Dynamic search in the Options section.
- Enter the Relative URI.
- Select an HTTP method.
- Enter the Resource identifier path.
- Enter a unique value in the Name field so that you can identify this lookup later.
- Click Save.
Create a static lookup
- Click the mappings icon on the import step. The Edit mapping window opens.
- Click the gear icon next to the field you are mapping. The Settings window opens.
- Click the gear icon next to the field you are mapping.
- In the Field mapping type section, click Lookup.
- Select Static: Value to value in the Options section.
- Enter the appropriate values for Export field value and Import field value.
- Enter a unique name in the Name field so that you can identify this lookup later.
- Click Save.
Lookup handlebar syntax
You can reference data retrieved from existing lookups in a flow with the following handlebars syntax.
Dynamic mapping:
{{lookup '<lookup name>' this}}
Static mapping:`
{{lookup '<lookup name>' this.<Export Field Name>}}
Comments
3 comments
For more information on how you can use advanced lookups in tandem with response mappings, take a look at this article: Response mapping and advanced lookups.
Confirmed that the Create HTTP import mapping with static or dynamic lookup doesn't include the actual valid handlebar expression by adding single quotes on the "lookup name". The following should have the actual Lookup handlebar syntax:
{{lookup '<lookup name>' this}}
{{lookup '<lookup name>' this.<Export Field Name>}}
Just provide the <lookup name> and <Export Field Name> and that should work. The HTTP Lookup Preview might not show the correct details (i.e., "{ASYNCID$0$8$}") though this is just a Preview interpretation. Running the flow would confirm the actual results of the lookup.
Thanks Ricko Borja, I revised the article per your correction.
Tom
Please sign in to leave a comment.