Lookup
AI-generatedOverview
This node performs a lookup operation where it searches for a value from the input data (needle) within a reference dataset (haystack) and outputs the matched result. It is useful for enriching data by matching keys between two datasets, such as finding user details from a list based on user IDs.
Use Case Examples
- Matching user IDs from an input list against a reference list of user profiles to enrich the input with full user details.
- Looking up product information from a catalog based on product IDs in an order list.
Properties
| Name | Meaning |
|---|---|
| Input Search Key | Property to pull the value used for the search from the input data. Supports dot notation (e.g., 'user.key'). |
| Reference Input Search Key | Property to scan for the value to match in the reference data. Supports dot notation (e.g., 'user.key'). |
| Output Key | Property name to output the found value to in the result item, if found. |
| Output Entire Matched Item as Result | Boolean flag to determine whether the output should return the whole matched item from the lookup or just specific properties. |
| Keys to Pluck From Matched | Comma-separated list of keys to extract from the matched item if 'Output Entire Matched Item' is false. Supports dot notation (e.g., 'user.name'). |
Output
JSON
result- The matched value or object from the reference data based on the lookup. It can be the entire matched item or specific properties depending on configuration.
Dependencies
- Requires lodash.get for deep property access.
Troubleshooting
- If the needle or haystack key values are not strings or numbers, the node throws an error indicating the type mismatch. Ensure the keys used for lookup are strings or numbers.
- If no match is found for a needle value in the reference data, the output key will be set to null for that item.
- Incorrect dot notation in keys may lead to undefined values; verify the key paths are correct.