Skip to main content

Notifications

Community site session details

Community site session details

Session Id : LHSFOgMJcQ7ZzW0Vp16xUu
Power Apps - Building Power Apps
Answered

Show values of selected checkboxes in dropdown

Like (0) ShareShare
ReportReport
Posted on 11 Sep 2023 02:11:19 by 63

Hi All

 

I have a custom datacard with a 20+ checkboxes.  I have a ClearCollect() for each checkboxes OnCheck and UnCheck property. to bring those 20+ items into a collection.

What i now want to do, is in a dropdown (or textbox) to return the values of the selected checkbox items.

KristyH_0-1694398021488.png

The DataCard Update property is : CollectionName

 

Dropdown

Items : CollectionName

DefaultSelectedItems: CollectionName

SelectMultiple: true

 

do i need to change the items for the Dropdown? if so, what should it be to update and show results as i check and uncheck the boxes?

  • KristyH Profile Picture
    63 on 12 Sep 2023 at 04:50:45
    Re: Show values of selected checkboxes in dropdown

    oh. thanks!

  • Verified answer
    v-mengmli-msft Profile Picture
    on 12 Sep 2023 at 04:42:58
    Re: Show values of selected checkboxes in dropdown

    Hi @KristyH ,

     

    Do you want the results to be populated into the Drop Down by default? If you use Drop Down, this has a limitation: you can't populate multiple options, so I suggest you change Drop Down to a Combo Box and set it up like this:

    Items:StartegySelection
    DefaultSelectedItems:Filter(StartegySelection,value=true)

    vmengmlimsft_0-1694493745067.png

     

    Best regards,

    Rimmon Li

  • KristyH Profile Picture
    63 on 12 Sep 2023 at 03:29:45
    Re: Show values of selected checkboxes in dropdown

    Thanks for that, i have double checked the code. i believe the problem was i had Value and not value in the last filter.

    the drop down now populates with the multiple selections., if i click the drop down. however, it does not show the multiple selections upon closing the dropdown.  i don't need it to be a dropdown box, i just want to see in Option1, Option2, Option 3 format in a text when i select or deselect the checkboxes

    KristyH_0-1694489373351.png

     

     

  • v-mengmli-msft Profile Picture
    on 12 Sep 2023 at 02:26:10
    Re: Show values of selected checkboxes in dropdown

    Hi @KristyH ,

     

    Please try this:

    Steps in my test.

    1)Check Box and DropDown:

    vmengmlimsft_0-1694484707579.png

    2)Code on the OnSelect of each Check Box:

     

    ClearCollect(yy,{check:Checkbox1.Text,status:Checkbox1.Value},{check:Checkbox2.Text,status:Checkbox2.Value},{check:Checkbox3.Text,status:Checkbox3.Value}
    );
    ClearCollect(yy,Filter(yy,status=true)
    )

     

    Since our settings have different names, I've changed the name to yours.

    ClearCollect(StartegySelection,
    {checkbox:Chk_Strategy1.Text,value:Chk_Strategy1.Value},{checkbox:Chk_Strategy2.Text,value:Chk_Strategy2.Value},{checkbox:Chk_Strategy3.Text,value:Chk_Strategy3.Value},
    {checkbox:Chk_Strategy4.Text,value:Chk_Strategy4.Value},{checkbox:Chk_Strategy5.Text,value:Chk_Strategy5.Value},{checkbox:Chk_Strategy6.Text,value:Chk_Strategy6.Value},{checkbox:Chk_Strategy7.Text,value:Chk_Strategy7.Value},{checkbox:Chk_Strategy8.Text,value:Chk_Strategy8.Value},{checkbox:Chk_Strategy9.Text,value:Chk_Strategy9.Value},{checkbox:Chk_Strategy10.Text,value:Chk_Strategy10.Value},{checkbox:Chk_Strategy11.Text,value:Chk_Strategy11.Value},{checkbox:Chk_Strategy12.Text,value:Chk_Strategy12.Value},
    {checkbox:Chk_Strategy13.Text,value:Chk_Strategy13.Value},{checkbox:Chk_Strategy14.Text,value:Chk_Strategy14.Value},{checkbox:Chk_Strategy15.Text,value:Chk_Strategy15.Value},
    {checkbox:Chk_Strategy16.Text,value:Chk_Strategy16.Value},{checkbox:Chk_Strategy17.Text,value:Chk_Strategy17.Value},{checkbox:Chk_Strategy18.Text,value:Chk_Strategy18.Value},
    {checkbox:Chk_Strategy19.Text,value:Chk_Strategy19.Value},{checkbox:Chk_Strategy20.Text,value:Chk_Strategy20.Value}
    );
    ClearCollect(StartegySelection,Filter(StartegySelection,value=true)
    )

    3)The Items of my Dropdown:

    vmengmlimsft_0-1694485035195.png

    The Items of your Dropdown:

    StartegySelection

    Please check if your above steps are correct.

     

    The result of my test:

    When I select the Chech Box1:

    vmengmlimsft_1-1694485261736.png

    When I select the Chech Box1 and Check Box2:

    vmengmlimsft_2-1694485303328.png

    If your setup is like mine, I recommend you first try setting up three checkboxes, run them and check the data in the collection.

     

    Best regards,

    Rimmon Li

  • KristyH Profile Picture
    63 on 12 Sep 2023 at 01:36:41
    Re: Show values of selected checkboxes in dropdown

    i have removed the OnCheck and UnCheck coding. but i still have the same issue.

    is there anythign else?

  • v-mengmli-msft Profile Picture
    on 12 Sep 2023 at 01:11:41
    Re: Show values of selected checkboxes in dropdown

    Hi @KristyH ,

     

    Of course, you need to clear your original OnCheck and OnUncheck settings, otherwise you will be performing different operations on the collection with the same name.

     

    Best regards,

    Rimmon Li

  • KristyH Profile Picture
    63 on 11 Sep 2023 at 23:15:19
    Re: Show values of selected checkboxes in dropdown

    here is a screenshot in App Preview Mode.  I have selected the dropdown and nothing is showing:

    KristyH_1-1694474074435.png

     

     

  • KristyH Profile Picture
    63 on 11 Sep 2023 at 22:44:06
    Re: Show values of selected checkboxes in dropdown

    do you mean to remove the code from OnCheck and OnUncheck? and only retain the OnSelect Code?

     

  • v-mengmli-msft Profile Picture
    on 11 Sep 2023 at 09:29:31
    Re: Show values of selected checkboxes in dropdown

    Hi @KristyH ,

     

    Do you mean that when you run the app, after selecting the checkbox, the value in the dropdown list is not updated? In my tests everything works fine, I suggest you use the code I provided earlier and clear your original settings.

     

    If there are errors, I hope you can provide some screenshots of the errors.

     

    Best regards,

    Rimmon Li

  • KristyH Profile Picture
    63 on 11 Sep 2023 at 03:34:23
    Re: Show values of selected checkboxes in dropdown

    actually.. it updated the dropdown with what was already ticked. but it didn't update in Play mode, when i tested ticked and unticking the checkboxes

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 89 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 60

#3
stampcoin Profile Picture

stampcoin 48

Overall leaderboard
Loading started