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 / Populate dropdown base...
Power Apps
Answered

Populate dropdown based on checkbox in a gallery

(0) ShareShare
ReportReport
Posted on by 1,257 Super User 2024 Season 1

I have a gallery with 2 checkboxes    CheckBoxYes   and CheckboxNo  and one label  Thisitem.LineItem

 

I would like to filter a dropdown to show only those items in the gallery where the check box  CheckBoxNo  has been checked.

 

I'm using this..  But it shows all of the items in the gallery not just the ones where checkboxNo is checked.

Filter(
 Gallery1.AllItems,
 CheckboxNo.Value = true
).LineItem

 

Any suggestions?

 

TIA

Categories:
  • TheRobRush Profile Picture
    11,128 Moderator on at
    Filter(ForAll(Gallery1.AllItems As theList, If(theList.CheckboxNo.Value=true,theList.LineItem)),Value)

    put that in dropdown items

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    No gives me 2 errors.  Forall has invalid arguments and filter has invalid arguments

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    ok I think I know what the issue is with your syntax.  The checkbox is not part of the items in the gallery it's just a check box added in so when I get to the 

    (theList.CheckboxNo.Value

    part of your code there is no option to put .Checkbox.value 

     

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    ok I've done it a different way!   I've created a collection when I check the no box and then put the collection as the items in the dropdown !  that seems to work

  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    Yah my checkboxes are in the gallery but NOT tited to the items of the gallery so default just set to false like so

    TheRobRush_1-1683836939456.png

     

    and then my dropdown is populating the two selected

    TheRobRush_2-1683836989974.png

    where my items property is

    Filter(
     ForAll(
     //Gallery Name
     Gallery8.AllItems As theList, 
     //Check Checkbox
     If(theList.Checkbox3.Value=true,
     //Which COlumn I want to go on my dropdown
     theList.WorkOrder)),
     ///final portion, returns value of above
     Value)

     

     

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Yes, this will also work, but don't forget to write the code for the onuncheck as well

  • vffdd Profile Picture
    1,257 Super User 2024 Season 1 on at

    Yes did forget that LOL thanks

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 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 283

#3
Mohsin Ali Profile Picture

Mohsin Ali 221

Last 30 days Overall leaderboard