Use a lookup cache in a flow to map values from stored data, or to retrieve stored data in a lookup step. This procedure is for builders who map data in flows.
Prerequisites:
- A lookup cache registered with the integration. See Register lookup caches with an integration.
- A flow that uses Mapper 2.0 or Transformation 2.0. For unsupported features, see Lookup caches overview.
Map a field with a lookup cache
For example, a flow moves customer data from Microsoft Dynamics 365 Business Central to Shopify. Business Central stores country and state as two-letter codes, and Shopify stores the full names, so GA, US in Business Central is Georgia, United States in Shopify. A lookup cache that stores the reference values maps both fields without a static or dynamic lookup.
- Go to Build
, and then select Flows.
- Open the flow.
- Select Mapping
on the import.
- Select Settings
next to the country destination.
- For Destination data type, select string.
- For Field mapping type, select Lookup.
- For Lookup type, select Lookup cache.
- For Lookup cache name, select the lookup cache. If it doesn't exist, create it. See Create a lookup cache.
- For Lookup cache value field, select the column that contains the full country name. If the lookup cache value is a string or number instead of an object, select $ to retrieve the complete value.
- Enter the path to the source value, for example
$.address.countryLetterCode.
Transformation 2.0 maps fields with lookup caches the same way.
Add a lookup step
For example, a flow sends a Slack notification when SKUs fall below a threshold. The threshold changes with market, customer, and business factors, so you store it in a lookup cache that your flows keep current. Update the lookup cache manually, or update it automatically with a flow. See Populate a lookup cache with a flow.
- Go to Build
, and then select Flows.
- Open the flow, and then add a lookup step after the export.
- Select Look up additional records (per record).
- Configure the lookup to retrieve the lookup cache entry.
- Add a filter so only records below the threshold pass to the next step.
- Add an import that sends the notification, and map the fields that passed the filter.
To retrieve lookup cache data in a field that supports handlebars, see Pull lookup cache data with the getLookupCacheData helper.