web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering using Listbox
Power Apps
Answered

Filtering using Listbox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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.

 

 

Categories:
  • Verified answer
    Mike8 Profile Picture
    1,330 on at

    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.

  • ThatAPIGuy Profile Picture
    925 on at

    @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! 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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 Profile Picture
    169 on at

    LISTBOX DEFAULT SELECT ALL

     

    ComboBox with multi select

    Items: Distinct(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 Profile Picture
    1,330 on at

    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 Profile Picture
    169 on at

    @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 Profile Picture
    1,330 on at

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

  • MK1 Profile Picture
    169 on at

    @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 Profile Picture
    1,330 on at

    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/

  • MK1 Profile Picture
    169 on at

    @Mike8,

    Hi Mike,

    I have created a swagger and i was able to createa custom connection to powerapps.

    but I'm unable to get values from that connection into a dropdown om powerapps.

     

    Thanks,

    MK

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard