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

Community site session details

Session Id : 7WIxcrUcJG14VZg617cE6V
Power Apps - Building Power Apps
Answered

How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

Like (0) ShareShare
ReportReport
Posted on 1 Mar 2022 19:12:36 by 92

Hi Everyone,

 

I am designing a form for my client, and they would like to have checkboxes.

 

I have converted the dropdown choice field into a gallery with a checkbox in it. The check box represents four values “Very Good”, “Satisfactory”, “Poor” and “Very Poor” that were in the dropdown choice field.

 

However, I also have another dropdown choice field(Internal Value, DatacardValue35) which has numbers from 1 to 4.

 

What I am trying to achieve is to allow the user to check a box which represents a choice value, for example “Very Good”. Once they have checked the box it will automatically select the number 4 from the other dropdown choice field.

 

I have tried using the if statement on check but nothing happens.

 

 

If(Checkbox1.Text = "Very Good", DataCardValue35.Selected.Value = "4");
If(Checkbox1.Text = "Satisfactory", DataCardValue35.Selected.Value = "3");
If(Checkbox1.Text = "Poor", DataCardValue35.Selected.Value = "2");
If(Checkbox1.Text = "Very Poor", DataCardValue35.Selected.Value = "1");

 

 

I would truly appreciate your assistance.

 

I have attached a picture.

 

 

Thank you.

 

Categories:
  • Teddy1 Profile Picture
    92 on 09 Mar 2022 at 14:54:37
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    I found another way of how to retrieve the selected check-boxes after submission. I read this post Solved: Re: Checkbox value in DisplayMode = view & edit - Power Platform Community (microsoft.com)

     

    It helped me to understand how I can tweak the default settings of my check boxes a bit faster. Through the use of this code:

    If(DataCardValue9.Selected.Value = Self.Text,true,false)

     

    Thank you for your Assistance @TheRobRush 

  • TheRobRush Profile Picture
    11,121 Moderator on 08 Mar 2022 at 18:51:06
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Read my previous response, it tells you how to prepopulate your checkboxes based on sharepoint list results.

    It will work if the options will always be one of a set number of options.

    If options will be different for each person/item because your option column allowed for custom additions and people are putting their own stuff into it that you cannot precode for, it would still be possible just slightly more complicated as youd need to add in a ungroup and number it then have all checkboxes set to lookup from that group based on row number etc.

     

    But like, if you will have lets say 10 checkboxes and they will always be same 10 items just checked or unchecked, my message up above will solve your issue

  • Teddy1 Profile Picture
    92 on 08 Mar 2022 at 18:42:44
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Well this is after I have submitted the information onto my SharePoint List. I want to give the end user the ability to make changes if they need to. And this is how the information is populated below on SharePoint.

     

    Hallway pic.jpg

     

    On Power Apps I created a Gallery that will show my SharePoint records and on-select of the Gallery I coded this:

     

    On select of the Gallery.jpg

     

    and on success of the form this what I coded:

    On success.jpg

     

    As for the check-boxes' on select and default. They are empty, no information has been coded in them.

  • TheRobRush Profile Picture
    11,121 Moderator on 08 Mar 2022 at 16:52:07
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Would have to see the column details of sharepoint list you have the checkbox value saved in (if this is an edit after submission, or if you mean edit while on same form before they submit, all the onselect info in checkboxes so i can see how you ended up setting up the variable

  • Teddy1 Profile Picture
    92 on 08 Mar 2022 at 14:30:17
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Hi @TheRobRush ,

     

    How about, if I want to give the user the option to edit the check-boxes they have checked already, to repopulate on the form. How do i go about it.

     

    I tried using this code on the Default settings of the check-boxes:

    Self.Text in Concat(ThisItem.'Hallways, lifts and internal communal hallways are clean and tidy',Value & ",")

    However, Powerapps did not like that. I got an error.

     

     

     

     

     

  • TheRobRush Profile Picture
    11,121 Moderator on 03 Mar 2022 at 19:23:00
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Just an alternate option to put in the oncheck of your checkboxes to make the result value a 1,2,3, or 4 instead of the actual text

  • Teddy1 Profile Picture
    92 on 03 Mar 2022 at 17:00:37
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Oh my, thank you and thank you so much Rob you have helped me solve my problem.

     

    But i got one question, Where does this code go?😅  sorry to be a pain, I'm still fairly new to Power Apps.😁

     

     

     

     

    Switch(
    
     Self.Text,
     "Very Good", Set(mychoiceVar,4),
     "Satisfactory", Set(mychoiceVar,3),
     "Poor", Set(mychoiceVar,2),
     "Very Poor", Set(mychoiceVar,1))

     

     

  • Verified answer
    TheRobRush Profile Picture
    11,121 Moderator on 02 Mar 2022 at 17:23:10
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Ok so here goes.

     

    I have made a form and connected it to my SPList with a choice column in it.

     

    The SPList Name is MasterSubAreas

    The Column containing my Choices is ItemList

    Column with Main name is ItemName.

    For the ItemList data card I have unlocked it and added 4 checkboxes,

    CheckBoxA

           Text Value of "Very Good"

    CheckBoxB

           Text Value of "Satisfactory"

    CheckBoxC

           Text Value of "Poor"

    CheckBoxD

           Text Value of "Very Poor"

    Their OnCheck has the value of

    Concurrent(
     Reset(
     CheckboxB),
     Reset(
     CheckboxC),
     Reset(
     CheckboxD));
    
    Set(mychoiceVar,Self.Text)

     

    (With each box being slightly different in the Reset Portion - One resets abc, one abd, one bcd, etc so that it resets anything that is not itself)

     

    That code above will set the variable to the text of the Checkboxes (Very Good, Satisfacotry... etc) You can change Set() portion to the following to make it 1,2,3 or 4.

     

    Switch(
    
     Self.Text,
     "Very Good", Set(mychoiceVar,4),
     "Satisfactory", Set(mychoiceVar,3),
     "Poor", Set(mychoiceVar,2),
     "Very Poor", Set(mychoiceVar,1))

     

    Now you will keep the actual drop down provided by initial auto creation of form, but hide it, and set its default selected items value to

    [mychoiceVar]

     

    Button that opens the form should have an onselect of

    Set(mychoiceVar,Blank());
    ResetForm(Form5);
    NewForm(Form5)

     

    then ofcourse the submit should read

    SubmitForm(Form5)

     Here are two images showing when checkbox selection changes, so does the info in the dropdown (which is what the form submits)

    checkboxinform1.PNGcheckboxinform2.PNG

  • Teddy1 Profile Picture
    92 on 02 Mar 2022 at 12:21:24
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    Thanks for getting back to me. 

     

    However I tried the Set(myChoiceVar,1) and I realised  a couple of issues.

     

    Firstly, the set variable only allows me to place a strict match up on a particular choice field option, regardless of what checkbox value is ticked, for example: if the user checks "Very Good" the value they will get back is 4 and if the user checks "Very Poor" they will still get back the value 4 instead of one.

     

    Secondly, I get an error when I place the global variable(myChoiceVar) into the Defaults and defaults selected item of the drop-down field.

     

    I understand the complexity of this problem. It's because there's only one checkbox in the gallery and I am requiring it to carry out a lot of actions. I am just trying to understand, what I am trying to achieve, is it possible?

     

    this the error

    Gallery checkBox 2.jpg

  • TheRobRush Profile Picture
    11,121 Moderator on 01 Mar 2022 at 19:37:43
    Re: How to make a Gallery Multi-Checkbox to Select an Option in a Dropdown Choice Field.

    I think what you would be looking for is something along the lines of setting on check of checkbox to

    Set(mychoiceVar, 1)

    with default selected item of your dropdown being mychoiceVar.

     

    in the oncheck you will also need to add a reset to your dropdown, as well as something to uncheck the other boxes, checkboxes are not really great for multiple choice wherein only one is selected tbh, they should really be using something liek the radio control.

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete