Home > CMS- Content Management System > Sharepoint > PowerApps Search and Filter functions

PowerApps Search and Filter functions

Hello everyone, welcome to my PowerApps series blog, in this blog we explore PowerApps search and filter functions. PowerApps include a “gallery”  that automatically shows items in a SharePoint list. This is great when you use the built-in search controls to find an item in the list or to use your application for submitting new items to your SharePoint list.

But what if you want your gallery to only show specific list items? Search gallery items based on more than two columns. PowerApps has a Filter and Search function.

Filter: The Filter function is used to find records in a table that meet formula criteria. This is the equivalent of how you would use the Filter in a SharePoint View or Excel to return multiple records from the list that match one or more criteria and discard those records that don’t.

Syntax: Filter(Table/Collection, Formula1 [, Formula2, … ] )

Here I have Emp data source:

Name Role Area
Coll Miller Technology India
Jack Miller Services India
Collen Jack IT US
Mack V Services US
Miller Brush Technology Canada

Example 1: Filter all person based on Role=Technology and that belongs to Area=Canada

QueryFilter(Emp, Role=”Technology” && Area=”Canada”)

Result
Name Role Area
Miller Brush Technology Canada

Example 2: Filter all person based on Area=Us

QueryFilter(Emp, Area=”US”)

Result
Name Role Area
Collen Jack IT US
Mack V Services US

Search: The Search function finds records in a table that contain a string in one of their columns.

Syntax: Search( Table, SearchString, Column1 [, Column2, … ] )

Example 1: Search all person that matches Name= “Mi”

QuerySearch(Emp, TextSearchBox1.Text, Name)

Result
Name Role Area
Coll Miller Technology India
Jack Miller Services India
Miller Brush Technology Canada

The above search result can also get through by a Filter function: Filter(Emp, TextSearchBox1.text in Name)

We also use a Filter and Search function in Sort() or SortByColumns().

Example 1: Filter all persons based on Role=Technology and sorted by Area in ascending order

Query:  Sort(Filter(Emp,Role=”Technology”),Area,Ascending)

Result
Name Role Area
Miller Brush Technology Canada
Coll Miller Technology India

 

Example 1: Sorts records based on Area in descending order

Query: SortByColumns(Emp,”Area”,Descending)

Result
Name Role Area
Miller Brush Technology Canada
Coll Miller Technology India
Jack Miller Services India
Collen Jack IT US
Mack V Services US
This Article is TAGGED in , , , , . BOOKMARK THE permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">