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

Galery Filter by Combobox (Sharepoint Choice column)

Hi Together,

 

i just try to Filter my Galery by a Combobox wich gets its Data from a Sharepoint List Column with the Type Choices.

 

I have Data in the column "P" like:

1, 2

1, 3

1

2

 

I now want to show in the Galery for example all Rows with "1" or with "1" and "2"

I dont find realy syntax for filtering in Power Apps "Items" Options on the Internet. 

 

I tried it with: (Galery "Items")

Filter(Table; P in ComboBox3.SelectedItems.P)

 

Maybe someone can Provide the right Syntax?

 

Thanks and Regards

Florian

1 ACCEPTED SOLUTION

Accepted Solutions

@WarrenBelz thanks for the tag, this was a really tough one. I couldn't solve it on my own, I had to use the magic of @RezaDorrani and one of his fantastic delegation videos. These should be in every Appsters toolkit!

 

@TheRealFlori 

I will try to give you the answers you need for your solution but you may need to adjust it slightly by watching the above video?

 

ComboBox3.Items is:

Choices(BLOG_DB.Plant)

Note: Reza uses a ClearCollect to get his choices whereas I've just used the Choices function. Not sure if my way causes any issues though?

 

Your Gallery needs to be a Flexible Height Gallery, where Gallery1.Items is:

BLOG_DB

 

Now, all the labels, dropdowns, datepickers you have in your gallery select them all using CTRL then Group them together. Then, the Visible property of this group is set to (this is pure magic!!):

"yes" in Concat(ForAll(ComboBox3.SelectedItems.Value, If(Value in ThisItem.Plant.Value, "yes", "no")), Value)

 

And that's it! Watch the video above if you get stuck, here it is in action:

ComboFilterMultiple.gif

 

Let me know if you get stuck

 

View solution in original post

20 REPLIES 20
Helper I
Helper I

So... if I Understand you correctly, you want the gallery to display only the items selected in the combobox? 

Yeah thats right.

If i select in the Combobox for example "1" and "2"

the Galery should show everything wich Contains "1" and "2" in the Column P

 

if i select in the Combobox for expaple "1"

the Galery should show everythin wich contains "1" in the Column P

Hi @TheRealFlori ,

Firstly, as the In filter is not delegable, the below will only work with data sets under 2000 items.

Happy to discuss workarounds collecting a set of this size if your data is bigger.

First, Collect the table - you can do this at Screen OnVisible

ClearCollect(
   colTable,
   MyTable
)

Replace the blue items with the actual names of your controls/fields

I will call the ComboBox MyCombo , the table MyTable and the field ColumnP.

The Items property of the gallery should be

Filter(
   colTable,
   ColumnP in MyCombo.SelectedItems
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

HI @WarrenBelz thanks for you Idea!

 

If tried your Idea but it don't worked in my App.

 

Screen OnVisible:

ClearCollect(
   colTable;
   BLOG_DB
)

 

Gallery Items:

Filter(colTable; P in ComboBox3.SelectedItems)

 Here it shows false argumenttyp. Table Values are not valid for these Kontext

 

I think its because of  the colTable or?

 

Regards

Flo

Thanks @TheRealFlori ,

Is P the name of your column in BLDG_DB ?

If so, have a look in your Collections (View > Collections) at colTable and see what is displaying in this column. If text, what values can you see. If a table "grid", click on this and see what values are inside.

Thank @WarrenBelz 

 

P is part of my SharePointlist BLOG_DB

 

i had a look at the collection. It shows a table and if i click on the Table ist shows the Value 1

on an other row it shows the Values 1 and 2

 

Regards

Flo

Ok Thanks @TheRealFlori ,

As you can realise, the structure of a data set determines how you need to reference it.

So assuming the table rows are headed 1 and 2 (the below has to be exactly as per the collection item heading) and for the moment I will assume 1 contains the information you are after then the gallery should be 

Filter(colTable; P.1 in ComboBox3.SelectedItems)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Thanks @WarrenBelz 

 

i thought about this to. But for my Programm it should not matter if the searched Value is in Row 1 or Row 2 and so on.

 

But for testing i tested your Idea

Filter(colTable; P.1 in ComboBox3.SelectedItems)

Now PowerApps wants an Operator such + or * 

 

i dont get the Syntax .... 😞

 

 

Hi @TheRealFlori ,

Is the heading of the collection table 1 or Value 1 or something else.

I cannot see your data structure and if the source field is a complex field type (multi-value), then that is why you were getting the first error - you cannot reference a table and expect it to match a text value. You need to reference the item of that table that matches.

So P has values inside of it and you need to reference the one that matches. If the heading on the table in the collection is "Value 1" then P.'Value 1' would get the text content you need to match to the other item.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (21,008)