cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DroningOn
Level: Powered On

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
Community Support Team
Community Support Team

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

DroningOn
Level: Powered On

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
PowerApps911
Level: Powered On

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. 

Community Support Team
Community Support Team

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

DroningOn
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (3,930)