cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
steven_S
Frequent Visitor

Filter gallery on multiple columns and only show unique items

I can't figure it out how to filter my SP list on two columns. 

 

Variable

varUserMail = User().Email

 

Columns

Behoriga

'Skapades av'

 

Formula

Filter ( Projekt; varUserMail in Behoriga.Email || varUserMail = 'Skapades av'.Email )

 

If you look at the picture,  in this example I would like to find 2 items in the gallery (ID 2 and 13). 

 

Filter(Projekt; varUserMail in Behoriga.Email)   <-- Finds ID 2

Filter(Projekt; varUserMail = 'Skapades av'.Email) <-- Finds ID 13

 

How do you combine them to show both items in the gallery? (And then it needs to only show unique items, maybe Distinct?)

 

Thanks in advance!

filter.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Same result, see below. It seems to be something with that built-in column 'Created by'.

 

image.png

 

I found a easy workaround till we found a solid solution 🙂

 

@gabibalaban  Thank you for your help and have a great weekend!

 

 

 

Created a new text column and just used User().Email as Default value.

 

 

image.png

 

 

image.png

 

 

 

 

View solution in original post

7 REPLIES 7
steven_S
Frequent Visitor

(I've tried collections, but they ruin my app further on)

gabibalaban
Super User
Super User

@steven_S ,

Your formula seems to be fine:

 

Filter ( Projekt; varUserMail in Behoriga.Email || varUserMail = 'Skapades av'.Email )

 

are you worried about the delegation warning ? or there is something else ? 

@gabibalaban Thanks for the reply.

Im fine with the delegation warning, but the formula just gives me items from one of the criterias. In this case 

varUserMail in Behoriga.Email

 

My user is now Oskar Johansson, so I should be able to se more than ID 4 Bar Himmel:

 

image.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If I run it with this formula I get 4 items - that I've created:

 

image.png

steven_S
Frequent Visitor

Ok, there is something going on with the columns. Maybe it's the built-in in column "Created by" that is causing the problem. I have to test that.

 

If I filter by StartDatum = "2021-08-01" I get ID 1 and 2

With SlutDatum = "2021-12-30" I get ID 4. Together it works fine, as you said:

 

image.png

 

Can you try to put each condition in brackets ?

Filter ( Projekt; (varUserMail in Behoriga.Email) || (varUserMail = 'Skapades av'.Email ))

 

Have you tried this ? For some reason it is possible that the system to check the condition a little bit different than you expect. 

Filter ( Projekt; (varUserMail in Behoriga.Email) || (varUserMail = 'Skapades av'.Email ))

 

Same result, see below. It seems to be something with that built-in column 'Created by'.

 

image.png

 

I found a easy workaround till we found a solid solution 🙂

 

@gabibalaban  Thank you for your help and have a great weekend!

 

 

 

Created a new text column and just used User().Email as Default value.

 

 

image.png

 

 

image.png

 

 

 

 

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!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,464)