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

Dropdown not filtering Gallery

Hi,

I have set up a dropdown box, pulling it's items from defined column entries in colum 'Tag Status', Data Source 'Tagging Results'.

I have a gallery pulling all info from data source 'Tagging results'.

I have also added a variable to display Gallery results based on User (if selected).

I would like the user to have the ability to filter the results by 'Tag Status' from the dropdown if the User Variable is not True.

My formula is set up with an If function to look at the variable and then to filter the results based on the Dropdown selected value.

 

If(minevar=true,Filter('Tagging results','Created By'.Email = User().Email),Filter('Tagging results','Tag Status'=Dropdown2.Selected.Value))

 

In this case I do not get any errors, just a warning, but the results do not display. Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Dropdown not filtering Gallery

Hi @Toddn ,

 

What is the column type of 'Tag Status' column? If it's a choice column, then the formula should be:

Filter('Tagging results','Tag Status'.Value=Dropdown2.Selected.Value)

Also, what is the formula that creates the variable minevar?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Super User
Super User

Re: Dropdown not filtering Gallery

The warning is probably about delegation because you are using User() in the formula. Is 'Tag Status' a text field?

 

To get around the delegation of User() add a global variable in the OnStart of the app or the OnVisible of the screen and set it to the email address of the user. Then use that variable in the filter formula.

 

Example: 

Global Variable: Set(gvUserEmail, User().Email)

Formula: If(minevar=true,Filter('Tagging results','Created By'.Email = gvUserEmail ),Filter('Tagging results','Tag Status'=Dropdown2.Selected.Value))



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Toddn
Level: Powered On

Re: Dropdown not filtering Gallery

Thanks so much for your reply. Unfortunately, when I tried it out it was not successful. I think that it is the 'Filter by dropdown' portion of the if function rather than the 'filter by user' portion. When I remove the 'Filter by dorpdown' section I am able to disply the gallery using the existing variable to navigate between all results and current user results.

If(minevar=true,Filter('Tagging results','Created By'.Email = User().Email),'Tagging results')

 

If i remove the 'Filter by user' portion and just leave the filter by dropdown portion I get an invalid argument type error. Screen Snip attached.

Thanks

Community Support Team
Community Support Team

Re: Dropdown not filtering Gallery

Hi @Toddn ,

 

What is the column type of 'Tag Status' column? If it's a choice column, then the formula should be:

Filter('Tagging results','Tag Status'.Value=Dropdown2.Selected.Value)

Also, what is the formula that creates the variable minevar?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Toddn
Level: Powered On

Re: Dropdown not filtering Gallery

Thank you so much, you were right, it is a choice column, I was missing that additional '.Value'.

Thanks again for saving the day, appreciate all the help.

 

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 290 members 5,649 guests
Please welcome our newest community members: