TL;DR: Use Lookup(Source, Condition, COLUMN) to return just the column value instead of Lookup(...).COLUMN, which fetches the whole record first.

💡 Challenge

Understanding the difference between Lookup(Source, Condition, COLUMN) and Lookup(Source, Condition).COLUMN, and optimizing your formulas for better performance.

✅ Solution

Use the direct-column syntax Lookup(Source, Condition, COLUMN) to retrieve only the needed value and avoid the extra record retrieval step.

🔧 How It’s Done

1. Use direct-column syntax

🔸 Syntax: Lookup(Source, Condition, COLUMN)

🔸 Benefit: Returns only the column value, improving performance.

2. Avoid record-first syntax

🔸 Syntax: Lookup(Source, Condition).COLUMN

🔸 Drawback: Retrieves the entire record then extracts the column, which is less efficient.

3. Compare with an example

🔸 Lookup(MyCollection, Age > 30, Name) returns the name directly.

🔸 Lookup(MyCollection, Age > 30).Name finds the record then extracts the name.

🎉 Result

By using the direct-column syntax, your app retrieves only what you need, leading to smoother performance and faster screen loads.

🌟 Key Advantages

🔸 Faster data retrieval by avoiding a full-record fetch

🔸 Simplified formulas that are easier to read

🔸 Reduced network and memory usage in your app

🛠️ FAQ

Q: What is the difference between Lookup(Source, Condition, COLUMN) and Lookup(Source, Condition).COLUMN?

The first returns the column value directly from the first matching record, while the second fetches the entire record then extracts the column, adding an extra step.

Q: When should I use the direct-column syntax?

Use it whenever you only need a single value from the matching record to improve performance and reduce data transfer.

Q: Can I always rely on Lookup(Source, Condition, COLUMN)?

Yes, but it only returns the first match. If you need multiple records or more complex logic, consider using Filter or other functions accordingly.

Marcel Lehmann

Marcel Lehmann

Microsoft MVP Microsoft MVP

BizzApps MVP from Switzerland 🇨🇭 - PowerPlatform Expert & Evangelist & MVP - Turning passion into expertise

MVP since 2023 Power Platform Expert since 2017