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

Get currently selected items from a ComboBox

Hi

I have two lists in SharePoint Online.

Companies and Articles.

There can be numerous Articles about a Company.

In the Articles list there is a Lookup to the Company List value "Title".

 

I am trying to filter the Articles Gallery by Company.

 

I created a Combo Box "cbFilterByCompany" with

DefaultSelectedItem = Choices(Articles.CompanyTitle)

And a Label with

Concat(cbFilterByCompany.SelectedItems, "CompanyTitle", ",")

 

But it just shows the text "CompanyTitle,CompanyTitle,CompanyTitle,CompanyTitle,CompanyTitle"

Also the Combo Box isn't displaying the names of the Companies (and it seems to be trying to show the names of comanies multiple times as there can be multiple articles about the same company)

 

thanks

P

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
cha_cha
Resident Rockstar
Resident Rockstar

This! This is still half baked answer but will do for now.

 

Filter(AddColumns(ProjectThamesRecentDevelopments,"CompNames",Concat(FirmTitle,Value,"##")),
        Dropdown1.Selected.Title in CompNames)

  


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

View solution in original post

36 REPLIES 36
cha_cha
Resident Rockstar
Resident Rockstar

Hello @pmwhelan 

 

Remove the quotes on the CompanyTitle.

 

Concat(cbFilterByCompany.SelectedItems, CompanyTitle, ",")

 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
pmwhelan
Helper V
Helper V

Many thanks.

 

Do you know how I'd filter the items in the gallery?

 

I try

 

Filter(Articles, CompanyTitle.Value in cbFilterByCompany.SelectedItems)

but it says expected a one-column table.

 

Thanks

 

cha_cha
Resident Rockstar
Resident Rockstar

Hello @pmwhelan 

 

Filter(Articles, CompanyTitle.Value in ShowColumns(cbFilterByCompany.SelectedItems),Title))

 

Replace Title with the actual name of the column.


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 

"Invalid number of arguments. expected 2 or more"

pmwhelan
Helper V
Helper V

I try this ...

 

Filter(Articles, CompanyTitle.Value in cbFilterByCompany.SelectedItems.CompanyTitle)

 

CompanyTitle isnt recognised.

Filter(Articles, CompanyTitle.Value in ShowColumns(cbFilterByCompany.SelectedItems,Title))

Try that, I added extra parenthesis earlier.


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
pmwhelan
Helper V
Helper V

The Function ShowColumns has some invalid arguments.

cha_cha
Resident Rockstar
Resident Rockstar

What's the name of the column of your company title?


 
Just in case you my answer helped you solve your problem, please mark/accept this as a SOLUTION This helps community members if they experience a similar issue in the future.

 
bistek.space   @cha_bistek    @BisTekSpace 
pmwhelan
Helper V
Helper V

In the Articles List I have a CompanyTitle column (which is a lookup to the Company list - it can also be multiselect)

thanks

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,254)