cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Filter a Gallery based on a values belonging to a collection

Hello,

 

I have a Gallery I want to filter. I want to display all elements whose categoryID are in a list of values, defined as a collection.

 

My collection "Categories" is : 1,2,3,4,5

 

I tried something like : Filter(Gallery, categoryID in Categories) but it doesn't work .

 

All the examples I could find with "in" operator only work with one value, not with a list (eg: "1" in categoryID)

 

Can anyone help on this, this would be so bad not to be able to do this !!

 

Regards

 

Guillaume

7 REPLIES 7
Highlighted
Community Support
Community Support

Re: Filter a Gallery based on a values belonging to a collection

Hi @Guillaume,

 

Would you please share a screenshot of the formula that you used to create the "Categories" collection?

Any error messages showing out with the formula you used?

 

I just tried that formula from my side, and it works.

The formula I used to create the collection is as below:

Collect(Categories,["1234","235","346"])

In addition, you may also take a try with the formula below:

Filter(Gallery, categoryID in Categories.value)

Image reference:

85.PNG

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper II
Helper II

Re: Filter a Gallery based on a values belonging to a collection

Hello Michael,

 

thanks for the reply. I used your way to define the following collection : Collect(SelectedCategories; ["1";"2";"3";"4";"5";"6";"7";"8"])

But sill I have the following error (translation from French) : Suggestion, a part of the formula can't be evaluated from distance. The right side of the operator "in" is not a column name

 

 

ErrorPA.jpg

 

 

 

 

 

Highlighted
Community Champion
Community Champion

Re: Filter a Gallery based on a values belonging to a collection

Hi @Guillaume

You need to add the column name, probably.  Please try this:

Filter(ServiceCatalogue, CategoryID in SelectedCategories.Value)

Also, you have an extra ; at the end of the formula

Highlighted
Anonymous
Not applicable

Re: Filter a Gallery based on a values belonging to a collection

Hi @Guillaume

 

Form your picture it seems you have an extra ; at the end which is causing the error. Try to remove it and see if it works

Highlighted
Helper II
Helper II

Re: Filter a Gallery based on a values belonging to a collection

Hello @Meneghino,

 

thanks for spotting this, now I remember I'd already tried this (with "Value"). Doesn't work either :

 

 

ErrorPA-2.jpg

 

 

New Member

Re: Filter a Gallery based on a values belonging to a collection

Did you find any solution? I'm stuck with a similar problem

Highlighted
Community Champion
Community Champion

Re: Filter a Gallery based on a values belonging to a collection

Hi @Riccardo_A,

It sounds like you are having an issue filtering your gallery against another collection. 

 

Can you share what formula you are currently using and how your app works? Screenshots would be helpful.

Microsoft Employee
@8bitclassroom

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,028)