cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DroningOn
Advocate I
Advocate I

How do I make a Dropdown a checkbox for a Two Optionset on edit form?

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?

2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

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:

https://powerusers.microsoft.com/t5/General-Discussion/CDS-entity-boolean-field-coming-as-dropdown-i...

https://powerapps.microsoft.com/cs-cz/blog/option-sets-and-many-to-many-relationships-for-canvas-app...

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@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)

View solution in original post

3 REPLIES 3
PowerApps911
Regular Visitor

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. 

v-yutliu-msft
Community Support
Community Support

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:

https://powerusers.microsoft.com/t5/General-Discussion/CDS-entity-boolean-field-coming-as-dropdown-i...

https://powerapps.microsoft.com/cs-cz/blog/option-sets-and-many-to-many-relationships-for-canvas-app...

 

 

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@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)

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,495)