Articles in this section

Pull lookup cache data with the getLookupCacheData helper

Use a lookup cache alias with the getLookupCacheData handlebars helper to retrieve configuration data at run time. The alias keeps resolving after you clone, snapshot, revert, or promote the integration with integration lifecycle management (ILM). This procedure is for builders who manage flows across environments.

For example, an integration runs in dev, staging, and production, and each environment uploads to a different SFTP directory. Store the three paths in a lookup cache and have each run retrieve the right one, instead of hardcoding the paths and editing them on every promotion.

Where the helper works

The helper works in settings that support handlebars, such as relative URIs, query templates, and FTP paths. It also works in Salesforce SOQL queries and NetSuite saved searches. It doesn't work in Mapper 1.0, Transformation Rules 1.0, or standalone flows.

Prerequisites:

  • A lookup cache registered with the integration, with an alias ID. For example, a lookup cache named environment-config with the alias ID envconfiglc. integrator.io saves alias IDs in lowercase, so use lowercase in the helper. See Register lookup caches with an integration and Create an alias.
  • One entry in the lookup cache for each environment. See Create a lookup cache.
  • A value in your flow that evaluates to the environment name, such as dev, staging, or production.

Add the helper to the flow

  1. Go to Build Build icon, and then select Flows.
  2. Open the flow, and then open the import that uploads the file.
  3. In a setting that supports handlebars, such as Directory path on the FTP import, enter the helper:

    {{getLookupCacheData "envconfiglc" record.environmentName "sftpPath"}}

    In this example, envconfiglc is the alias ID, record.environmentName is the key of the entry to retrieve, and sftpPath is the property to return.

    Put the alias ID in quotation marks. The helper doesn't accept the lookup cache name or ID in place of the alias ID. If you leave out the property, the helper returns the whole value as JSON. To return a default when the key or property isn't found, add it as a fourth argument. Without a default, the result is empty.

When you clone or promote the integration with ILM, envconfiglc keeps pointing to the same lookup cache, so the path resolves with no remapping.