cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Filtering using Listbox

Hi, I am trying to filter a Gallery using a ListBox but not succeeding.

 

The Listbox has a 3 options specified in Items:

["Yes","No","TBC"]

 

The expression i am using for the Gallery is:

Filter('Enquiries List',Approved_x0020_by_x0020_Ax in ListBox1.SelectedItems.Value)

 

Approved_x0020_by_x0020_Ax is a column in my Sharepoint List (Enquiries List) which is of the Type "Choice" where the options are: Yes, No, TBC.

 

I can't see what i'm doing wrong, so any help is appreciated.

 

Thanks.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Filtering using Listbox

Hello jamesdixon,

It also didn't work when I tried it.
I added
ListBox1.OnSelect= UpdateContext({vSelectedItems: ListBox1.SelectedItems.Value})
and
Gallery1.Items = Filter('Enquiries List',Approved_x0020_by_x0020_Ax in vSelectedItems)
and it works.

View solution in original post

12 REPLIES 12
Highlighted
Solution Sage
Solution Sage

Re: Filtering using Listbox

Hello jamesdixon,

It also didn't work when I tried it.
I added
ListBox1.OnSelect= UpdateContext({vSelectedItems: ListBox1.SelectedItems.Value})
and
Gallery1.Items = Filter('Enquiries List',Approved_x0020_by_x0020_Ax in vSelectedItems)
and it works.

View solution in original post

Highlighted
Super User
Super User

Re: Filtering using Listbox

@Anonymous

 

Try this 

 

Filter('Enquiries List',Approved_x0020_by_x0020_Ax in ListBox1.Selected.Value)

 

you need to use .Selected.Value instead of .SelectedItems.Value

 

Hope it works out! 


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Anonymous
Not applicable

Re: Filtering using Listbox

Thanks @Mike8. I also figured out that I needed to change:

Approved_x0020_by_x0020_Ax

to

Approved_x0020_by_x0020_Ax.Value

 

I'm guessing because in my Sharepoint list this is a choice item.

 

Highlighted
Helper IV
Helper IV

Re: Filtering using Listbox

LISTBOX DEFAULT SELECT ALL

 

ComboBox with multi select

ItemsDistinct(Filter(Product,Name.Id=Dropdown.Selected.ID),Title)

ListBox

Items: Distinct(Filter(product,Title in Listbox.SelectedItems),Description)

Default:LookUp(Product,Title in listbox.SelectedItems.Result,Description)

textInput: Concat(ADDescription.SelectedItems,Result&",")

 

while using this scenario, Its working when there is only one item in the combobox and if we select it the description is selected default and added to the textbox

But, when we select multiple items in the combobox, on description it shows both descriptions are selected but its only populating one description on top of the list.

Can you help me with were i'm messing with the formula.

Thanks in advance.

MK

Highlighted
Solution Sage
Solution Sage

Re: Filtering using Listbox

Hello MK1,

Can you try instead of
Default= LookUp(Product,Title in listbox.SelectedItems.Result,Description) 
DefaultSelectedItems = Filter(Product,Title in Listbox.SelectedItems.Result)
Does it work like this?
If not, c
an you please explain a bit more what you are trying to do..?
Some screenshots may help.


Highlighted
Helper IV
Helper IV

Re: Filtering using Listbox

@Mike8,

 

Hi Mike,

We don't have a property called DefaultSelectedItems on a listbox.

I tried to use a combobox and it worked Smiley Happy 

Thanks a lot

Highlighted
Solution Sage
Solution Sage

Re: Filtering using Listbox

Yes, my mistake. 
I am glad that you made it work 🙂

Highlighted
Helper IV
Helper IV

Re: Filtering using Listbox

@Mike8

Hi,

In my screnario,

I need to get values into the dropdown from a swagger custom connetion.

 

Is there any way to get values from swagger into a dropdown.

i tried to get user infromation using custom connection, but here i'm trying to get more than 10 values into a dropdown using a custom swagger connection.

Please let e know if anyone have tried this.

 

Thanks in advance

Highlighted
Solution Sage
Solution Sage

Re: Filtering using Listbox

Hello,

Yes, it is possible.
Have you created the swagger file?
If yes, you can use this as reference
https://powerapps.microsoft.com/nl-nl/blog/register-and-use-custom-apis-in-powerapps/

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

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

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (9,932)