Sanjay Makwana
What is difference between search, lookup and filter functions in Power Apps?

What is difference between search, lookup and filter functions in Power Apps?

By Sanjay Makwana in Power Apps on Mar 03 2023
  • Tuhin Paul
    Mar, 2023 7

    In Power Apps, the search, lookup, and filter functions serve different purposes:

    Search: The Search function is used to find records in a data source that match a specific set of criteria. It allows you to search across multiple columns of a table or a collection for a specific value or set of values. The syntax for the Search function is:

    1. Search(datasource, searchstring, column1, column2, ..., columnN)

    For example, the following formula searches for records in a SharePoint list called “Employees” that contain the text “John” in either the “First Name” or “Last Name” column:

    1. Search(Employees, "John", "First Name", "Last Name")

    Lookup: The Lookup function is used to retrieve a specific record from a data source based on a matching value in a specific column. It is commonly used to retrieve a single value from a related table or list. The syntax for the Lookup function is:

    1. Lookup(datasource, column, value)

    For example, the following formula retrieves the email address for an employee with the ID “12345” from a SharePoint list called “Employees”:

    1. Lookup(Employees, "ID", "12345", "Email")

    Filter: The Filter function is used to retrieve a subset of records from a data source based on a set of criteria. It allows you to filter a table or a collection based on one or more conditions. The syntax for the Filter function is:

    1. Filter(datasource, condition1 && condition2 && ... && conditionN)

    For example, the following formula retrieves all records from a SharePoint list called “Employees” where the department is “Sales” and the location is “New York”:

    1. Filter(Employees, Department = "Sales" && Location = "New York")

    The Search function is used to find records based on a specific text string, the Lookup function is used to retrieve a specific record based on a matching value in a specific column, and the Filter function is used to retrieve a subset of records based on a set of conditions.

    • 1
  • Rajkiran Swain
    Apr, 2023 3

    In Power Apps, the search, lookup, and filter functions are used to retrieve data from a data source, but they have different purposes and behaviors:

    Search: The search function is used to find records in a data source that match a specified search term. It returns a table of records that contain the search term in one or more fields. The search function is commonly used with galleries or data tables to filter data based on user input. The syntax for the search function is: Search(datasource, searchstring, [fieldname1, fieldname2, …]).

    Lookup: The lookup function is used to retrieve a single record from a data source based on a specified condition. It returns a record that matches the condition or null if no record is found. The lookup function is commonly used to retrieve related data from a secondary data source. The syntax for the lookup function is: Lookup(datasource, condition, [fieldname1, fieldname2, …]).

    Filter: The filter function is used to retrieve a subset of records from a data source based on one or more conditions. It returns a table of records that meet the specified conditions. The filter function is commonly used with galleries or data tables to display only the records that meet specific criteria. The syntax for the filter function is: Filter(datasource, condition1 && condition2 && …, [fieldname1, fieldname2, …]).

    In summary, the search function is used to find records that contain a specific search term, the lookup function is used to retrieve a single record based on a specific condition, and the filter function is used to retrieve a subset of records based on one or more conditions.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS