Filter, Search and Lookup functions in Power Fx | Canvas Apps

Here’s how you can use and understand the difference between Filter, Search and Lookup functions if you are new to making Canvas Apps. I’ve tried to explain the usage of these in simple examples!

These functions are part of the Power Fx and are used in Canvas Apps.

  1. Lookup Function – Lookup function in Canvas Power Apps | Power Fx Formula Example
  2. Search Function – Search function in Canvas Power Apps | Power Fx Formula Example
  3. Filter Function – Filter function in Canvas Power Apps | Power Fx Formula Example

Differences between Filter, Search and Lookup

Results inMultiple RecordsSingle RecordMultiple Records
Search TypeCriteria BasedCriteria BasedText Based

Here’s Microsoft Learn link for detailed criteria & documentation:

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!


Implement real-time search in Gallery of CDS records in a Canvas Power App | Power Platform

One of the most common asks is to be able to search CDS records in a Gallery control in real-time using a Text-box.

Search Box & Gallery connected to CDS

Let’s design a simple gallery that is populated with CDS records from Account entity.

  1. Take a Text Input control (Textbox) and make it look like a Search Box.

    In order to have the Search watermark, write the text to appear as water-mark, enter it in Hint text property of the Text input

  2. Take a Gallery control and select Data Source as Accounts from CDS.

    The way the above shown Gallery control is populated is by selecting a CDS Data Source which is as below –

Filter records

Finally, there’s a 1-line formula that will do the trick for you

  1. In the Items property of the CDS Gallery, I have to filter the records based on the Text of the Text Input on my form.

    Marked by green arrow Filter() function is the one which handles filtering of the data set based on the parameters demanded by the method. Here’s Microsoft Docs on the same –

    Underlined by red Accounts is the CDS data source which I want to filter on.

    StartsWith() is a method which is used to compare the start of the string in question. In this case, the text I enter in the SearchField textbox.

    1. ‘Account Name’ is the field in the Accounts dataset to be considered on which the search parameter is dependent.
    2. Underlined by purple SearchField.Text in which SearchField is the textbox which is used to query the Name of the Account and .Text is Text value of the string which will be considered.

    So at all times, whenever there’s a change in the Textbox value, the Items of the Gallery control are supposed to be updated with the filtered records.


Now, when you use the App, here’s what it will behave like. As you type, the records will filter with a certain delay (depending on how large your dataset is)

Hope this was useful!!

Here are some more Canvas Power Apps posts you might want to check –