cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
HansHeintz
Level 8

How do I write back to the "two option" field of an entity

Microsoft explains  a two option field as beeing boolean.

Still If I replace the option selector in a datacard with a toggle I cannot use

MyToggle.Value in the update property of the datacard.

It wants an OptionSetValue.

I set the values in the structure editor as "Ja" and "Nee".

"Ja" or OptionSetValue("Ja") do not work either.

What is the magic word?

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: How do I write back to the "two option" field of an entity

Hi @HansHeintz 

 

You can update a two option field as:
 
Patch([@Entity1S],Defaults([@Entity1S]),{Name:"Test",TwoOptionsField: 'TwoOptionsField (Entity1S)'.Ja})
Here, I have an entity "Entity1S" with attribute TwoOptionsField that is added as Two options fields. The highlighted part of formula is the way to pass this two option value. Please replace your actual field property in the formula or you can select this from the suggestions.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Community Support Team
Community Support Team

Re: How do I write back to the "two option" field of an entity

Hi @HansHeintz ,

Do you want to replace the Original ComboBox within the "Two Option" field data card with a Toggle control?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:5.JPG

Set the Update property of the "IsOverdue" data card within the Edit form to following:

If(
Toggle1.Value = true,
'IsOverdue (TaskLists)'.Yes,
Toggle1.Value = false,
'IsOverdue (TaskLists)'.No
)

On your side, you should set the Update property of the "Two Options" field data card in your Edit form to following:

If(
    MyToggle.Value = true,
    'Two Option Field (EntityName)'.Ja,               /* <-- 'Two Option Filed' represents your Two Option field name */
    MyToggle.Value = false,
     'Two Option Field (EntityName)'.Nee
)

Please take a try with above solution, then check if the issue is solved.

 

Note: The "Two Options" type column is actually a Option Set type column in CDS Entity. More details about setting a value for Option set type column, please check the following blog:

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

 

Best regards,

Community Support Team _ Kris Dai
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

4 REPLIES 4
Super User
Super User

Re: How do I write back to the "two option" field of an entity

Hi @HansHeintz 

 

You can update a two option field as:
 
Patch([@Entity1S],Defaults([@Entity1S]),{Name:"Test",TwoOptionsField: 'TwoOptionsField (Entity1S)'.Ja})
Here, I have an entity "Entity1S" with attribute TwoOptionsField that is added as Two options fields. The highlighted part of formula is the way to pass this two option value. Please replace your actual field property in the formula or you can select this from the suggestions.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Community Support Team
Community Support Team

Re: How do I write back to the "two option" field of an entity

Hi @HansHeintz ,

Do you want to replace the Original ComboBox within the "Two Option" field data card with a Toggle control?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:5.JPG

Set the Update property of the "IsOverdue" data card within the Edit form to following:

If(
Toggle1.Value = true,
'IsOverdue (TaskLists)'.Yes,
Toggle1.Value = false,
'IsOverdue (TaskLists)'.No
)

On your side, you should set the Update property of the "Two Options" field data card in your Edit form to following:

If(
    MyToggle.Value = true,
    'Two Option Field (EntityName)'.Ja,               /* <-- 'Two Option Filed' represents your Two Option field name */
    MyToggle.Value = false,
     'Two Option Field (EntityName)'.Nee
)

Please take a try with above solution, then check if the issue is solved.

 

Note: The "Two Options" type column is actually a Option Set type column in CDS Entity. More details about setting a value for Option set type column, please check the following blog:

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

 

Best regards,

Community Support Team _ Kris Dai
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

HansHeintz
Level 8

Re: How do I write back to the "two option" field of an entity

If(
Toggle1.Value
;'GewichtGeschat (DierExtra)'.Ja
;'GewichtGeschat (DierExtra)'.Nee
)

I never would have guessed.

Thanks!

Rkaur
Level: Powered On

Re: How do I write back to the "two option" field of an entity

// Sorry, posted my reply on wrong window! Please ignore.

//Couldnt find a way to delete it

 

Hi Kris,

 

i tried your suggestion so i understand there is a different way to write to a Two Options column.

however, i strongly feel the problem is around my datasource name is not highlighted in green. its a custom CDS entity and im on a trial env. anything around it that i should check ?

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 360 members 3,739 guests
Please welcome our newest community members: