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.
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
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
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.
On Power Apps I created a Gallery that will show my SharePoint records and on-select of the Gallery I coded this:
and on success of the form this what I coded:
As for the check-boxes' on select and default. They are empty, no information has been coded in them.
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
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.
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
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))
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)
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
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.
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473