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
Mike8
Level 10

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
Mike8
Level 10

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

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.

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.

 

MK1
Level: Powered On

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

Mike8
Level 10

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.


MK1
Level: Powered On

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

Mike8
Level 10

Re: Filtering using Listbox

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

MK1
Level: Powered On

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

Mike8
Level 10

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 387 members 4,454 guests
Please welcome our newest community members: