cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
i-worx_charlie
Regular Visitor

Gallery Filter connected to Drop down and current user

Hi Everyone,

 

I am currently trying to create a Gallery which passes through 2 filters. I am quite new with this and my field is not related to this, however I have been tasked to create this PowerApp. I am not sure if this is possible but if it is, that would be great.

 

Here is the first part of the filter which is working:
Filter(Expenses, 'Created By'.Email = User().Email)

 

What this is doing is that it's filtering the gallery by the Current user opening the app, by email; and it is showing the expected results.

 

What I am trying to filter down further is a calendar period from a dropdown which source is from a completely different list.

It looks like below:


Filter(Expenses, PeriodEnding.Value = Expenses_PeriodEnding, PeriodEnding.Value)

 

Current List setup:

 

Expenses - This list has all essential information pertaining to the expense list (item, category, Period Ending, etc) -- The column which has the Data to match is "PeriodEnding"

 

Expenses_PeriodEnding - This list simply just has the Period Ending dates -- the actual "date" is in the column: PeriodEnding

Attached is a screenshot as to what I am currently working with.

 

Any ideas to accomplish this?

 

The next step is to create an HTML report from the gallery, however I will give my best efforts until i ask that.. as I did with this filter!

 

What is seen in the screenshot:

 

Dropdown (In which the already filtered gallery will be further filtered):

Items: Expenses_PeriodEnding

Value: PeriodEnding

 

Gallery: Filter(Expenses, 'Created By'.Email = User().Email)

 

Goal: Filter the gallery further by drop down (Period ending is also the 4th row in the gallery, which I'm trying to match via filter)

 

Please let me know if for assistance more information is required..

 

Thanks for the help everyone.

1 ACCEPTED SOLUTION

Accepted Solutions

Good day,

 

I have figured out how to accomplish this.

 

The last time I posted here, the "choice" menu was not able to be filtered. What I did was I created a new calculated column which converted the "period ending" values into text, which allowed me to filter.

 

The calculated value in the column appears as this:

=TEXT(Period_Ending,"mm/dd")

 

As for the gallery Filter, my final code was:

 

Filter(
Expenses,
'Created By'.Email = User().Email,

PE2TEXT = drp_PeriodEnding.Selected.Value
)

 

Thanks all for the help. Next one for me is to export the filtered gallery into PDF / HTML, and after that fix the delegation issue.

 

 

 

View solution in original post

6 REPLIES 6
rubin_boer
Super User
Super User

hi @i-worx_charlie welcome to the community.

 

You can have the gallery  Items = Filter(Expenses, And('Created By'.Email = User().Email, PeriodEnding <= YourDateDropwn.Selected.YourColumn)

 

That will give you the dates before or on the period ending date.

 

Hpe it helps

 

 

Hi @rubin_boer, Thank you for assisting me with this. It looks like the filter is "working" however it still comes up empty in the gallery. I am using this formula:

 

Filter(Expenses, 'Created By'.Email = User().Email, PeriodEnding <= Expenses_PeriodEnding.Selected.PeriodEnding)

 

i-worx_charlie_0-1614797207712.png

 

Would this be because in the gallery, date "period ending" date is shown as numerical values but the drop down is shown as Month/day/year?

 

rubin_boer
Super User
Super User

hi there @i-worx_charlie 

 

please try changing the formula to Filter(Expenses, 'Created By'.Email = User().Email, PeriodEnding <= Date(2021,4,15)) and see what it does.

 

 

 

Hi @rubin_boer 

 

I was able to input this into the formula: Filter(Expenses, 'Created By'.Email = User().Email, 'Period Ending' <= Date(2021,4,15))

 

I noticed that PeriodEnding wasn't in the main gallery list, but 'Period Ending' was so I added that instead. Unfortunately it still is not filtering properly -- still empty in the gallery.

i-worx_charlie
Regular Visitor

Hello All,

 

So I have been still trying to work this out and I have found a way for the filter to work on multiple conditions, however it seems that with the way that this is set up, the 2nd part of the filter *DOES NOT* work when the List Item is set to "Choice". Does anyone have a workaround / solution for this?

 

Here is my current gallery item property:

Filter(
Expenses,
'Created By'.Email = User().Email,
'Period Ending' = drp_PeriodEnding.Selected.Value)

 

drp_PeriodEnding.Selected.Value is a drop down I created. The gallery is now filtering from that down down, but when the drop down option is a "Choice" in the original gallery list (Expenses), it does not filter.

 

If anyone has any ideas, that would be greatly appreciated!

 

C

Good day,

 

I have figured out how to accomplish this.

 

The last time I posted here, the "choice" menu was not able to be filtered. What I did was I created a new calculated column which converted the "period ending" values into text, which allowed me to filter.

 

The calculated value in the column appears as this:

=TEXT(Period_Ending,"mm/dd")

 

As for the gallery Filter, my final code was:

 

Filter(
Expenses,
'Created By'.Email = User().Email,

PE2TEXT = drp_PeriodEnding.Selected.Value
)

 

Thanks all for the help. Next one for me is to export the filtered gallery into PDF / HTML, and after that fix the delegation issue.

 

 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,305)