Why this pattern
Power Automate doesn't have a native JOIN operator across data sources. The recommended approach is to retrieve each dataset, build a lookup map and iterate to enrich the primary list. This page documents a clean, reusable version of that pattern.
Steps
- Retrieve list A from source 1 (e.g., SharePoint list).
- Retrieve list B from source 2 (e.g., Excel table or SQL).
- Build lookup: use
Select+Composeto project list B into a key → value object. - Join: iterate over list A, look up matching keys in B's object and produce the enriched record.
- Write output to the destination (Excel, Dataverse, email, etc.).
Performance tips
- Avoid nested
Apply to each— it scales O(n·m). Use a Compose-based lookup instead (O(n)). - Trim list A and B server-side with OData filters before bringing data into the flow.
- Cache the lookup object in a variable to avoid re-evaluation in each iteration.
Want to see more automations?
See Invoice OCR Automation