lingdanglfw(DAX)

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

Filter Search Lookup in PowerApps

 

In PowerApps, we can use the Filter, Search, and LookUp function.
 

Filter Function

 

The Filter function finds the records in a table. It must satisfy a formula. We can use Filter to find a set of records with the conditions. If the condition becomes true, it displays the records; else, it discards.

 

Syntax

 

Filter (Table, Formula1 [, Formula2, ... ] )

 

Explanation

  • Filter-Keyword
  • Table-Table Name
  • Formula- We apply the formula (If you search more than one column)
Follow the below steps to work with Sort in PowerApps.
 

Step 1 - Log in to the PowerApps

 

After downloading the PowerApps from the Windows Store, we need Microsoft related organization’s Office 365 ID or (MSDN, Microsoft, Skype, Office 365, etc.) to login with it.

 
PowerApps
 

Step 2 - Create a New App in PowerApp

 

After login, we can see the Dashboard. There, click on the New button.

 
PowerApps
 

Step 3 - Choose the Blank app

 
PowerApps
 

Step 4 - Designing the App

 

Now, let's start designing the app. On the left side, we can see the individual screens for adding our data. On the right side, we see the list of Layouts. On the top, there is a formula bar. There, we have the Properties of the screen that we select. 

 
PowerApps
 

Step 5 - Choose the Blank Layout.

 
PowerApps
 

Step 6 - Insert a Button from the Insert menu.

 
PowerApps
 

Step 7 - Add the code

 

Click on the Button and add the following code to the OnSelect Event.

 
PowerApps
 

Coding

 
  1. ClearCollect(SivaEnterprise, {  
  2.     ProductNo: 100,  
  3.     ProductName: "Keyboard",  
  4.     Rate: 500  
  5. }, {  
  6.     ProductNo: 579,  
  7.     ProductName: "Mouse",  
  8.     Rate: 600  
  9. }, {  
  10.     ProductNo: 112,  
  11.     ProductName: "DVD",  
  12.     Rate: 1500  
  13. }, {  
  14.     ProductNo: 856,  
  15.     ProductName: "Modem",  
  16.     Rate: 500  
  17. }, {  
  18.     ProductNo: 469,  
  19.     ProductName: "Processor",  
  20.     Rate: 5000  
  21. })  

Step 8 - Run the app.

 
PowerApps
 

Step 9 - Click on the "Display" button and close the Preview window.

 
PowerApps
 

Step 10 - To Display the data

 

Now, go to the File menu and choose the Collections.

 
 

It will display the content in the table format.

 
PowerApps
 

Examples for Filter Function

 

Example 1

 

ClearCollect(SivaEnterprise, Filter( SivaEnterprise, Rate > 500 )))

 

Explanation

 

It will sort the table where the values in the Rate column are greater than 500.

  • ClearCollect- It deletes all the records from a collection and then adds a different set of records to the same collection.
  • SivaEnterprise-It’s the table name.
  • Filter-Keyword
  • SivaEnterprise- Collection name.
  • Rate-Column name to sort with the condition (greater than 500).
Output
 
PowerApps
 

Example 2

 

ClearCollect(SivaEnterprise, Filter( SivaEnterprise, "Mo" in Lower( ProductName ) ))

 

Explanation

 

It will sort the ProductName by the record which starts from “Mo”

 

Output

 
PowerApps
 

Search Function

 

The Search function finds records in a table. The string may occur anywhere within the column. Searching is case-insensitive and unlike Filter and LookUp, the Search function uses a single string to match instead of using a formula.

 

Syntax

 

Search( Table, SearchString, Column1 [, Column2, ... ] )

 

Explanation

  • Search - Keyword
  • Table - Table Name
  • SearchString - The string to search for.
  • Column(s) - The names of columns within Table to search
Examples for Search Function
 

Example 1

 

ClearCollect(SivaEnterprise,Search (SivaEnterprise, "DVD", "ProductName"))

 

Explanation

 

It will display the DVD.

  • ClearCollect- It deletes all the records from a collection and then adds a different set of records to the same collection.
  • SivaEnterprise-It’s the table name
  • Search-Keyword
  • SivaEnterprise- Collection name
  • DVD, ProductName-Field name and Column name to Search
Output
 
PowerApps
 

LookUp Function

 

The LookUp function finds the first record in a table that satisfies a formula. Use LookUp to find a single record that matches one or more criteria.

 

Syntax

 

LookUp( Table, Formula [, ReductionFormula ] )

 

Explanation

  • LookUp - Keyword
  • Table - Table Name
  • Formula- We apply the formula (If you search more than one column)
  • ReductionFormula - Optional. This formula is evaluated over the record that was found, reducing the record to a single value.
Examples for LookUp Function
 

Example 1

 

ClearCollect(SivaEnterprise,LookUp( SivaEnterprise, ProductName = "Modem", Rate ))

 

Explanation

 

It will display the Rate of the Modem.

  • ClearCollect- It deletes all the records from a collection and then adds a different set of records to the same collection.
  • SivaEnterprise-It’s the table name
  • LookUp-Keyword
  • SivaEnterprise- Collection name
  • Modem, Rate-Rate of the Modem in the Rate Column
Output
 
PowerApps
 

Example 2

 

ClearCollect(SivaEnterprise,LookUp( SivaEnterprise, ProductName = "Keyboard" )

 

Explanation

 

It will display the Keyboard records only.

 

Output

 
PowerApps
 

Conclusion

 

 how to use the Filter, Search, and Lookup Functions in Microsoft PowerApps and how to run it.

posted on   lingdanglfw  阅读(83)  评论(0编辑  收藏  举报

编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
点击右上角即可分享
微信分享提示