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

Filter gallery by SP Lookup column, via combobox of same list source

Hi all,

I'm just a little confused at being able to filter a gallery based on a combobox whose source is a separate SP list, and where the gallery's SP column I am trying to filter by is a lookup column from the same separate list.

 

I have a SP list 'Supportive Product Library' which just has the column 'Product Name'. This list feeds into multiple lookup columns on multiple SP lists so I can't just turn it into a choice column.

 

The gallery that I am trying to filter comes from a document library called 'R&D Level Documents'. The column I want to filter by is called 'Marketing Supportive Products' and is a lookup column from 'Supportive Product Library' (column 'Product Name'.)

(Both lists are connected as data sources).

 

So I created a combobox to list all 'Product Names' in my 'Supportive Product Library' list. Items property is:

'Supportive Product Library'.'Product Name'

Works great.

 

I want to filter the gallery's 'Marketing Supportive Products' lookup column based on the results of my combobox.

Gallery Items property is:

Filter('R&D Level Documents','Marketing Supportive Products'.Value in ComboBox1.Selected.Value)

 

I have tried to mirror other code I have seen in other posts and this is the closest I can get but it still throws argument warnings. I'm sure I'm just missing some setup/syntax. Appreciate the help!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter gallery by SP Lookup column, via combobox of same list source

Hi @Sephiel ,

Do you mean that Marketing Supportive Products is a mutiple lookup field?

Is your combo box multiple choice?

I assume that it is single choice.

If so, please try this:

1)set the combo box's Items:

 

Choices('Supportive Product Library'.'Product Name')

 

2)set the gallery's Items:

 

Filter('R&D Level Documents',ComboBox1.Selected.Value in'Marketing Supportive Products'.Value)

 

// since  Marketing Supportive Products is a mutiple lookup field, 'Marketing Supportive Products'.Value will return a table, you could only set: value in table, not table in value.

What's more, 'Supportive Product Library'.'Product Name' will not return a table with a field named Value. It will return a table with a field named 'Product Name'. While Choices('Supportive Product Library'.'Product Name') will return a table with a field named Value.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

5 REPLIES 5
Super User
Super User

Re: Filter gallery by SP Lookup column, via combobox of same list source

@Sephiel 

Do either of these work?

Filter('R&D Level Documents','Marketing Supportive Products'.Value = ComboBox1.Selected.Value)
Filter('R&D Level Documents','Marketing Supportive Products'.Value in ComboBox1.SelectedItems.Value)

 

Let me see the warning message if neither works.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Sephiel
Level: Powered On

Re: Filter gallery by SP Lookup column, via combobox of same list source

@mdevaney 

I just realized I didn't mention that the gallery is filtering a column that allows multiple values (Marketing Supportive Products). Ugh, is that beyond the limitations of PowerApps for a lookup column?

 

Here's what I get for the first code:

Capture2.PNG

Capture3.PNG

 

And the second code:

Capture4.PNG

 

Thanks for the help! 🙂

Super User
Super User

Re: Filter gallery by SP Lookup column, via combobox of same list source

@Sephiel 

The red underline means the column name "Value" does not exist.  It must be something else.

 

What options does the autocomplete give?  Suggest you try a few.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Community Support Team
Community Support Team

Re: Filter gallery by SP Lookup column, via combobox of same list source

Hi @Sephiel ,

Do you mean that Marketing Supportive Products is a mutiple lookup field?

Is your combo box multiple choice?

I assume that it is single choice.

If so, please try this:

1)set the combo box's Items:

 

Choices('Supportive Product Library'.'Product Name')

 

2)set the gallery's Items:

 

Filter('R&D Level Documents',ComboBox1.Selected.Value in'Marketing Supportive Products'.Value)

 

// since  Marketing Supportive Products is a mutiple lookup field, 'Marketing Supportive Products'.Value will return a table, you could only set: value in table, not table in value.

What's more, 'Supportive Product Library'.'Product Name' will not return a table with a field named Value. It will return a table with a field named 'Product Name'. While Choices('Supportive Product Library'.'Product Name') will return a table with a field named Value.

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
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

Sephiel
Level: Powered On

Re: Filter gallery by SP Lookup column, via combobox of same list source

@v-yutliu-msft 

 

Aha, yes you were right that I had my 'in' operator backwards! That fixed the vast majority of the problems. For some reason, using Choices in this case didn't seem to pan out. I ended up going in a bit of different direction for filtering (though I may revisit this idea later.) Unfortunately I think what I'm ultimately going for is a little outside my skill level...will take more than a couple of days to figure it out! (I believe I'm ultimately wanting cascading comboboxes but in a manner that, right now, reads from disparate data sets...I think it's a data organization problem first and foremost 😊)

 

Thanks a bunch, I do have simple dropdowns working with the functions in the correct order now 😁

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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