Articles in this section

getDataLookupCache helper

The {{getDataLookupCache}} helper retrieves a value from a lookup cache — an account-level resource that stores reusable data for fast retrieval across flows — directly in your Handlebars template. Unlike the {{lookup}} helper, which only reads lookups defined in the same flow step, {{getDataLookupCache}} can read from any lookup cache registered to your integration.

Usage 

Reference the helper with the alias ID of the lookup cache, the key that identifies the record you want, and two optional parameters for narrowing down or defaulting the result: 

{{getDataLookupCache _lookupCacheAliasID key pathToValue defaultValue}}
  • _lookupCacheAliasID (required) - The alias ID that identifies the lookup cache you want to read from. 
  • key (required) - The key that identifies the specific record you want in that lookup cache. Accepts a path in your input or a hardcoded string with "". 
  • pathToValue (optional) - The path to a specific value within the record, using dot notation. Omit this parameter to return the entire value. If the value is an object, it is stringified, that is, converted into a plain text string. 
  • defaultValue (optional) - The value to return if no matching record or path is found. Omit this parameter and the helper returns an empty string when there's no match.

Examples 

The following examples all reference a lookup cache with the alias ID 65548203b, which contains this record under the key 101:

{
  "firstName": "John",
  "lastName": "Doe",
  "age": 30,
  "position": "Software Engineer",
  "department": "Engineering",
  "salary": 80000,
  "address": {
    "street": "123 Tech Street",
    "city": "Codeville",
    "country": "USA"
  },
  "projects": [
    { "name": "ProjectA", "status": "In Progress" },
    { "name": "ProjectB", "status": "Completed" }
  ]
}
  • Return a top-level value 

To return a simple field from the record, supply its name as pathToValue:

{{getDataLookupCache "65548203b" "101" "firstName"}} 

This returns "John". 

  • Return a nested value 

To return a value from inside a nested object, chain the field names with dot notation: 

{{getDataLookupCache "65548203b" "101" "address.city"}}

This returns "Codeville". 

  • Return a value from an array 

To return a value from inside an array, use the item's index in the path:

{{getDataLookupCache "65548203b" "101" "projects.0.name"}}

This returns "ProjectA", the "name" value of the first item in the "projects" array. 

Tips 

  • If the key or path you specify doesn't match any data in the lookup cache, the helper returns an empty string unless you supply a defaultValue.
  • Omit pathToValue to return the complete record as an object, rather than a single value.
  •  _lookupCacheAliasID always requires quotes; key, pathToValue and defaultValue require double quotes only if hardcoded in templates.