Use a flow to create and update lookup cache entries when the data isn't in a CSV file, can't be downloaded from the source application, or changes often. An import step sends each record to the lookup cache upsert API as one key-value entry. This procedure is for builders who already created a lookup cache.
Prerequisites:
- A lookup cache. See Create a lookup cache.
- The lookup cache ID. Go to Resources
, and then select Lookup caches. At the end of the lookup cache row, select Actions
, and then select Edit. Copy the ID from the end of the browser address.
- A Celigo APIs connection with Full access.
Example flow
The following flow stores inventory data in a lookup cache named Product SKUs:
- An export retrieves inventory items from Shopify.
- A lookup adds inventory level details, such as location, sku, and threshold, to each record by
item_id. - An import creates or updates entries in the Product SKUs lookup cache.
Request body structure
The import sends this structure as the request body of the upsert API, POST /v1/lookupcaches/{_id}/data. All properties are required.
| Property | Description |
|---|---|
data |
An array of entries. |
key |
A unique string for each entry. |
value |
The data for the key. For allowed types, see Create a lookup cache. |
{
"data": [
{
"key": "46451277299909",
"value": {
"sku": "111111",
"location": "Main Shop",
"threshold": "5"
}
}
]
}Add the import step
- Go to Build
, and then select Flows.
- Open the flow that retrieves the data.
- Add an import step that uses the Celigo APIs application, and then select your Celigo APIs connection.
- Under How would you like the records imported?, set Option to Invoke Celigo standard resource APIs, Resource to Lookup cache, and API endpoint to Upsert data in a lookup cache.
- For Lookup cache ID, enter the lookup cache ID.
- Map each source record to one entry in
data, using the structure above. - Check that the entries appear in the preview.
If one source record creates more than one entry, the import step returns an error. See Troubleshoot lookup caches.
For other lookup cache API endpoints, see the Lookup caches API reference.