I'm working on an edit form and want to take the dropdown provided when inserting a Two Option datafield, from CDS, into a checkbox. When I delete the dropdown and insert the check box the Update field on the data card throws an error saying that its expecting an OptionSet Value. I can't find a solution in any available online resources to this problem. There must be something obvious I'm missing?
Solved! Go to Solution.
Hi @DroningOn ,
Could you tell me what option set of the two options field?
I've made a similar test, you could refer this:
I use Yes/No as the two options field's option set.
Set the datacard's Update:
If(Checkbox1.Value=true&&Checkbox2.Value=false,'filedname (entity name)'.Yes, Checkbox1.Value=false&&Checkbox2.Value=true,'fieldname (entity name)'.No
)
Please note that two options will be recognized as a Option Set type column in PowerApps. To update its value, you need to use formula like:
'field name(YourEntityName)'.option .
You could refer this for more details:
Best regards,
Community Support Team _ Phoebe Liu
@PowerApps911 Thanks for the response! I'm a Shane Young fan and checked his youtube channel for any relevant info prior to posting this. I appreciate your suggestion, but it looks like there's no (obvious to me) way to grab the numerical value from a two option set to use, when you open the field in CDS theres no way to dive further into the two option set to get details on either of the two options.
@v-yutliu-msft Your solution was exactly what I was looking for! I had read that blog post but I guess I didnt really grok the 'field name (entity name)'.option syntax from it, which looking back is fairly obvious now.
For any one who finds this later, in order to convert to a fully responsive checkbox/toggle two option datacard that will be checked if you return to the form to edit, change the following:
Change the Update function under the advanced tab to:
If(ToggleOrCheckbox.Value=true, 'field name (entity name)'.option1, 'field name (entity name)'.option2)
For the Toggle or Checkbox control itself change the default value under the advanced tab to:
If(ThisItem.'FieldName' = 'FieldName (entity name)'.option1, true, false)
I think this video by Daniel Christian might help understand better how Option Sets work. https://www.youtube.com/watch?v=pj7AJy_UVIw I believe your answer is you will need to turn the options into their numeric values.
Hi @DroningOn ,
Could you tell me what option set of the two options field?
I've made a similar test, you could refer this:
I use Yes/No as the two options field's option set.
Set the datacard's Update:
If(Checkbox1.Value=true&&Checkbox2.Value=false,'filedname (entity name)'.Yes, Checkbox1.Value=false&&Checkbox2.Value=true,'fieldname (entity name)'.No
)
Please note that two options will be recognized as a Option Set type column in PowerApps. To update its value, you need to use formula like:
'field name(YourEntityName)'.option .
You could refer this for more details:
Best regards,
Community Support Team _ Phoebe Liu
@PowerApps911 Thanks for the response! I'm a Shane Young fan and checked his youtube channel for any relevant info prior to posting this. I appreciate your suggestion, but it looks like there's no (obvious to me) way to grab the numerical value from a two option set to use, when you open the field in CDS theres no way to dive further into the two option set to get details on either of the two options.
@v-yutliu-msft Your solution was exactly what I was looking for! I had read that blog post but I guess I didnt really grok the 'field name (entity name)'.option syntax from it, which looking back is fairly obvious now.
For any one who finds this later, in order to convert to a fully responsive checkbox/toggle two option datacard that will be checked if you return to the form to edit, change the following:
Change the Update function under the advanced tab to:
If(ToggleOrCheckbox.Value=true, 'field name (entity name)'.option1, 'field name (entity name)'.option2)
For the Toggle or Checkbox control itself change the default value under the advanced tab to:
If(ThisItem.'FieldName' = 'FieldName (entity name)'.option1, true, false)
User | Count |
---|---|
126 | |
87 | |
85 | |
75 | |
69 |
User | Count |
---|---|
215 | |
180 | |
139 | |
97 | |
83 |