How to use IF formula, filter, and sort a gallery in PowerApps
Rajan Masurkar
Microsoft Power Platform Developer | PowerApps | Power Automate | Power BI | Robotic Process Automation (RPA) | SharePoint Online | Dataverse | C# | SQL Server
In PowerApps, the IF formula, filter, and sort features are incredibly useful for managing data in a gallery. In this article, we'll take a closer look at each of these features and show you how to use them effectively.
Using the IF formula
The IF formula is used to test whether a condition is true or false. If the condition is true, a specified value or formula is returned. If the condition is false, another specified value or formula is returned. To use the IF formula, follow these steps:
- Select the control that you want to apply the formula to.
- In the formula bar, type the following formula: If(condition, true_value, false_value)
- Replace 'condition' with the expression that you want to test. In my case is use the IF formula for the ascending and descending order of a workers data in gallery.
- Replace 'true_value' with the value or formula that you want to return if the condition is true.
- Replace 'false_value' with the value or formula that you want to return if the condition is false.
- I use the following formula.
?If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
Filtering a gallery
Filtering a gallery allows you to display only the items that meet certain criteria. To filter a gallery, follow these steps:
- Select the gallery that you want to filter.
2. In the formula bar, type the following formula: Filter(datasource, condition)
领英推è
3. Replace 'datasource' with the name of the data source that you want to filter.
4. Replace 'condition' with the expression that defines the filter criteria, In my case i use the filter for starts with Title.
Filter([@'Worker Directory-RM'], StartsWith(Title, TextSearchBox1.Text)
Sorting a gallery
Sorting a gallery allows you to display the items in a specific order. To sort a gallery, follow these steps:
- Select the gallery that you want to sort.
- In the formula bar, type the following formula: Sort(datasource, column, ascending/descending)
- Replace 'datasource' with the name of the data source that you want to sort.
- Replace 'column' with the name of the column that you want to sort by.
- Replace 'ascending/descending' with the sorting order that you want.
Conclusion:
PowerApps is a versatile tool that can help you streamline your business processes. With the IF formula, filtering and sorting galleries, you can create powerful custom applications that meet your specific needs.
#cloudjobs?#jobready?#certified?#microsoftcertified?#learning?#powerbi?#programming?#powerbi?#powerbideveloper?#powerapps?#powerbidesktop?#powerbijobs?#powerbihiring?#powerbiservice??#functions #powerappsdevelopers #powerapps #sorting #filtering #appdeveloper #powerful?#hiring?#freshers?#thankyou?#microsoftlearn?#jobseekers?#jobseeker?#job?#jobfinder??#BuildTogether?#mvpbuzz?#microsoftmvp?#businessapplications?#businessapps?#poweraddicts?#networking?#communityfirst?#communityrocks?#communityengagement?#leadership?#freshers?#freshersjobs
I