The {{lookup}} helper retrieves data from lookups you define in the same flow step, but cannot reference lookups from other steps. In the AFE 2.0 screen, you can open the Create/manage lookup drawer to configure these lookups. The drawer supports two types:
-
Dynamic search: You define the search in the destination application, and then also the single string field value from search results that you want to return.
-
Static: value-to-value: You define the value to value mappings (e.g., “apple” → “banana”).
You must give each lookup a unique alphanumeric name that will be used to reference it in your Handlebars template.
For a dynamic search lookup, reference the lookup name without quotes in your template:
{{lookup.myDynamicLookup}}
For a static: value-to-value lookup, wrap the lookup name in quotes and supply the value to match:
{{lookup “myStaticLookup” record.someField}}
Use these exact naming conventions (with or without quotes) based on how you created the lookup in the same flow step.
-
Dynamic search lookup
Suppose you created a dynamic search lookup called
shippingLookup, which retrieves the first shipping method from your destination application (shipping[0].method). To use it in your handlebars template:{{lookup.shippingLookup}}If the dynamic search returns
"Overnight"as the method, then{{lookup.shippingLookup}}yields"Overnight". -
Static value-to-value lookup
Imagine you set up a static lookup named
stateAbbreviationthat maps full state names to abbreviations, for example:-
"California" -> "CA" -
"New York" -> "NY" -
"Texas" -> "TX"
When building your import record, you can convert a user’s address state to its abbreviation:
{{lookup “stateAbbreviation” record.shippingAddress.state}}If
record.shippingAddress.stateis"Texas", the helper returns"TX". -
Tip
-
Make sure your lookup’s alphanumeric name in the handlebars matches exactly what you defined in the Create/manage lookup drawer (static lookups require quotes, dynamic do not).
-
For dynamic lookups, verify your JSON path in the destination application’s response is valid (e.g.,
products[0].name). -
Previewing from the AFE step will only show placeholder results, but when you run the flow the lookups will execute as expected.