Nested Filters in PowerApps.

Introduction:

In this blog, we will learn how to use Nested filters in PowerApps.

Use Case:

We have a Gallery(GalleryQuoteLineDetail) where we need to put filter which equals Quote Product selected in another Gallery. Once we get those Quote Products, we need to filter the Gallery(GalleryQuoteLineDetail) based on ‘Transaction Type’ Field,  which is a field on Quote Product. The ‘Transaction Type’ should be equal to “Project Contract”.

Solution:

Steps to be followed:

1. Below is the CDS Data Source, we want to filter.

2. To filter the Gallery Based on another Gallery, Use the below Formula:

Items property of Gallery:

     Set: GalleryQuoteLineDetail.Items: Filter( 'Data Source',Condition)

     For eg: GalleryQuoteLineDetail.Items : Filter('Quote Line Detail','Quote Line'.'Quote Product' =  GalleryQuoteLine.Selected.'Quote Product')

 

3. To filter the Gallery Based on “Transaction Type”, Transaction Type is of Option Set Data Type, Use the below Formula:

Items property of Gallery:

     Set: GalleryQuoteLineDetail.Items : Filter( 'Quote Line Detail',  'Transaction Type' in "Project Contract" )

4. To Combine both the Filters in a single Formula, use the first filter as ‘Data Source’ of the second filter:

Following is the formula:

 Filter( 
      Filter
      ('Quote Line Detail',
          'Quote Line'.'Quote Product' =  GalleryQuoteLine.Selected.'Quote Product'
       ),
       'Transaction Type' in "Project Contract"
)

 

Conclusion:

Hope this Blog helps you to combine multiple Filters into single Filter.


Share Story :