I have Dataverse table with column created as "Yes/No" type.
When I create PowerApps it will display as "Drop", instead we want to have checkboxes for Yes and No option. Also if a user selects one option the other one should be automatically unchecked.
For that I have used below steps.
1. Create gallery under Column_datacard.
2. Set existing datacardvalue1.Visible =false
3. Set exisiting Datacardvalue1.DefaultselectedItem = ForAll(details, {Value:Title})
3. insert Checkbox under the Gallery.
4. Set Checkbox "Label" property=ThisItem.Value
5. Set gallery "Items" Property =Choices('Column(TableName)')
6. Set Oncheck Property on checkbox as "Collect(details, {Title:ThisItem.value})
6. Set ONUncheck property on checkbox as "removeIF(details, Title=ThisItem.value)
Here I am trying to collect details using collections. Now the issue is that we can select both the answers from this checkbox. Because this is part of gallery, I am not sure how to set rule if one is selected then the other should automatically uncheck. Is there any other alternative solution for this instead of going through all these steps?
End of the day we need to save content back to Dataverse column.
@rajkumar88 The best solution is to use a Radio control. Please follow these steps (In my case I have a Dataverse table called People and a Yes/No field called Happy),
1. Add this field to the form, remove the dropdown and add a Radio control.
2. Set the Items property for the Radio control like below,
3. Set the default of the Radio control to,
4. Set the Update property of the DataCard to,
All done!
@CNT , I don't see "Default" Property for Radio Group at all. I am using right Radio control? I can and input acttion called "RadioGroup". And I used this one to set "Items" but even "Items" is also showing it as 0 and 1 instead of "yes or No" option.
-
Select the Radio Control to see its Items and Defaults property. When you select the Radio control, you will see, the name "Radio" in the Properties pane,
Initially the Radio will show 0 and 1. When you set the Items property correctly like I have shown (Setting it to ["Yes","No"] WILL NOT WORK in your case , then it will change to Yes and No.
Hope this helps!
@rajkumar88 If you share the name of your Dataverse table and the name of the Choice field, I can give you the exact formulas (send screen shots). Thanks!
@CNT , I have used exactly as you mentioned. Still no luck. Below screen shot doesn't show anywhere "default property".
I did applied RadioGroup exactly with the choice formula.
And then updated CovidpositiveDatacard with the radiogroup1.selected.value.
@rajkumar88 OK. Got it. You are in PowerApps for Teams and Radio works differently there.
1. To change 0,1 to Yes and No, do this,
2. Set the DefaultSelectedItems to,
Hope this helps!
Thanks A lot. It worked fine now.
User | Count |
---|---|
255 | |
112 | |
92 | |
48 | |
38 |