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

Notifications

Announcements

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:
I have the same question (0)
  • 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard