cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper 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
Highlighted
Community Support
Community Support

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

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

Highlighted
Helper I
Helper I

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

@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
Highlighted
Regular Visitor

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

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. 

Highlighted
Community Support
Community Support

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

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

Highlighted
Helper I
Helper I

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

@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

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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