When planning or building your flows, you can use lookup caches to store data and quickly access it in your flows using Mapper 2.0, Transformation 2.0, or lookup cache API endpoints. If you'd like to better understand how lookup caches are used in flows, consider the below examples and then try them in your own flows. This article focuses on configurations for only the lookup or lookup cache, not all flow steps.
This example flow includes a single export and import so that we can move the customer data from Microsoft Dynamics 365 Business Central to Shopify when shipping products globally from the shop.
In this flow, the customer data has country and state fields in the address which are stored differently in the two applications. In Business Central, these details are provided in the short form as two letters, whereas in Shopify these details are provided in the full form. For example, in a customer address, GA, US in Business Central would be Georgia, United States in Shopify. In this scenario to match the data correctly, that is, for the customer details to flow smoothly from Business Central to Shopify, we can create a lookup cache rather than a static lookup or dynamic lookup to store the reference values and map the state and country names quickly and easily.
After you've created your export and import steps, you can map the fields using Mapper 2.0 lookups:
-
Click the mapping icon that shows next to your import.
-
In the Edit mapping form, in Mapper 2.0, click the Settings (gear) icon next to the "country" field.
-
In the Destination data type, select "string".
-
In Field mapping type, select "Lookup".
-
For Lookup type, select Lookup cache.
-
In Lookup cache name, select the cache if it's already created. Otherwise, create a new cache.
-
-
In the Edit Mapping form, for Lookup cache value field, select the column that contains the full name of the country.
Tip
if your lookup cache value is not an object, but a string or number, select
$
to retrieve the complete value. -
Enter the Source field. For example,
$.address.countryLetterCode
. -
Click Save and close.
Note
Likewise, based on your requirements, you can use lookup caches to map the fields with Transformation 2.0.
This example includes three steps, that is, an export, a lookup, and an import so that a Slack notification is sent to stakeholders when SKUs fall below a threshold limit.
In this flow, since the inventory items and threshold could change based on market, customer, or business factors, the lookup cache data that stores the threshold should always be accurate, up-to-date, and the same across flows where it is used. In this scenario, to ensure that our lookup cache has the latest info, we can either create the cache and update it manually or create and update the lookup cache data automatically using a flow. (For details, see creating lookup caches in Create & manage lookup caches.)
After you've created the Shopify export step, you can add a lookup step and configure it using lookup cache APIs.
-
Click Resources > Export to create an export.
-
Select Lookup additional records (per record).
-
In What would you like to export? configure the fields as shown.
-
Click Save and close.
Finally, add an import step using a Slack connection. But before that, set up a filter so that only records below a specific limit pass through from the previous step. Then, map the data that has passed through so that a notification about low inventory is sent to your channel to alert stakeholders.