The PowerApps LookUp function helps to find a record (first record) in a table that satisfies a formula. You can use the LookUp function to find a single record that matches one or more criteria. In this article, we will explore PowerApps LookUp Function.
What is LookUp in PowerApps?
The LookUp function in PowerApps is a powerful formula that allows you to search for specific records in a table or data source based on certain conditions. By utilizing this function, you can retrieve a single record or a collection of records that match your criteria. Whether you need to find a customer in a CRM system or locate an inventory item in a database, the LookUp function proves invaluable for retrieving data from a specific row. With its versatility, this function enables you to streamline various scenarios and efficiently access the information you need.
What is the difference between LookUp and Filter functions in PowerApps?
When working with PowerApps, both the LookUp and Filter functions play important roles in searching and retrieving data from tables or data sources. While they serve similar purposes, there are notable differences in their behavior and usage.
The PowerApps LookUp function focuses on finding a single record in a table or data source that matches specific criteria. It returns the first record that meets the criteria or a default value if no matching record is found. This function is commonly used when you need to locate a particular record based on a unique identifier or when you know that the criteria will yield only one result.
On the other hand, the PowerApps Filter function is designed to locate multiple records in a table or data source that satisfy specific criteria. It returns a table containing all the records that meet the criteria, or an empty table if no matches are found. The Filter function is particularly useful when you want to extract a subset of records based on specific conditions, such as retrieving all customers residing in a particular city or retrieving all orders placed on a specific date.
Read more: Filter function in PowerApps
Syntax:
LookUp( Table, Formula [, ReductionFormula ] )
Where,
LookUp = Function Name
Formula = It specifies the formula by which each record of the table is evaluated
ReductionFormula = It specifies the formula of a record that was found. It helps to reduce the record to a single value. The function returns the full record from the table if you don’t use this formula.
Example:
To use PowerApps LookUp, you need to add a record in the PowerApps Screen. For this click on the below link to add a record.
After adding a record, follow the below steps to use PowerApps LookUp:
STEP 1: Add a Label (Insert -> Label) in your Power apps Screen.
STEP 2: Select the Label and put the below formula in the Label formula bar:
Text = LookUp(CandidateInfo, Address ="India", Name )
Where,
LookUp = Function Name
CandidateInfo = Collection Name
Address, Name = Collection Field Name
You can take any Collection field values such as (Name, Mobile Number, and ID).
Here, we have a result:
Conclusion
The LookUp function is used to search for a single record based on a specific set of criteria, while the Filter function is used to search for multiple records that meet a set of conditions.
Comments