cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iemdan
Level: Powered On

Filtering the gallery from multiple sources

I'm experiencing code block here. 

What I'd like to do:

  • Filter a gallery of mobile phones
    • Filtering by the cell phone's battery capacity ( i.e. 3500 mAh)
    • Filtering using two or three pickers: 1 list box and 1 single dropdown list, each is connected to a different database

What the issue is:

the code I put in there does not seem to have the right syntax.

 

Code (right on the "Item" of the gallery called resultDisplayFinal:

Filter(
resultDisplay.AllItems,
Storage >= Max(
UseList.SelectedItems,
storageUse
),
Memory >= Max(
UseList.SelectedItems,
memoryUse
),
Battery >= Max(
Filter(
Table1_1,
frequencyOptions = DayTimeFrequency.Selected
),
batteryUse
),
Display >= Max(
UseList.SelectedItems,
displayUse
),
Camera >= Max(
UseList.SelectedItems,
cameraUse
)
)

 

4 REPLIES 4
Community Support Team
Community Support Team

Re: Filtering the gallery from multiple sources

Hi @iemdan ,

Which data source does your resultDisplay connect to?

 

Based on the formula that you provided, I think there is something issue with it. The First argument of your Filter function should be the data source your resultDisplay connect to rather than resultDisplay.AllItems.

 

Please consider modify your formula as below:

 

Filter(
       'YourDataSource',
       Storage >= Max(UseList.SelectedItems, storageUse),
       Memory >= Max(UseList.SelectedItems, memoryUse),
       Battery >= Max(Filter(Table1_1,frequencyOptions = DayTimeFrequency.Selected),batteryUse),
       Display >= Max(UseList.SelectedItems, displayUse),
       Camera >= Max(UseList.SelectedItems, cameraUse)
)

Note: The 'YourDataSource' represents the data source your resultDisplay connect to.

 

More details about the Filter function in PowerApps, please check the following article:

Filter function

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
iemdan
Level: Powered On

Re: Filtering the gallery from multiple sources

Thanks. I changed tha datasource to the original database. Battery filter still not working.

Community Support Team
Community Support Team

Re: Filtering the gallery from multiple sources

Hi @iemdan ,

Is there something error with the formula you provided?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please check if you have typed proper Filter conditions within the Filter function.

 

Based on the conditions that you provided, it would filter your data source records whose Storage column value is greater than the maximum Storage value of these selected items in your list box, and Memory column value is greater than the maximum Memory value of these selected items in your list box, and Battery column value is greater than the maximum Battery value of these selected items in your list box, and Display column value is greater than the maximum Display value of these selected items in your list box, and Camera column value is greater than the maximum Camera value of these selected items in your list box.

 

Please check if there are records which meet above filter conditions existed in your data source. You could take a try with following formula in your Gallery:

Filter(
       'YourDataSource',
        Storage >= Max(UseList.SelectedItems, storageUse)
)
Filter(
       'YourDataSource',
       Memory >= Max(UseList.SelectedItems, memoryUse)
)
Filter(
       'YourDataSource',
       Battery >= Max(Filter(Table1_1,frequencyOptions = DayTimeFrequency.Selected),batteryUse)
)

...

...

 

then check if the proper records could be displayed in your Gallery. If true, I think there may have something issue with the Filter conditions you typed in your Filter function.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
iemdan
Level: Powered On

Re: Filtering the gallery from multiple sources

Hi Kris,

 

I'm attaching some screens.

 

So when I tried just 

Filter(
       'YourDataSource',
        Battery >= Max(UseList.SelectedItems, batteryUse)
)

It seemed to work no problem ( see first screen)

 

then I applied

Filter(
       'YourDataSource',
       Battery >= Max(Filter(Table1_1,frequencyOptions = DayTimeFrequency.Selected),batteryUse)
)

 

and it doesn't seem to work, and came with warning sign ( see 2nd and 3rd screens) 

 

Did I do something wrong?

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,068)