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

boolean patch to cds

I have what used to be an easy deal with SQL patch for boolean value on a selected Gallery record:

            Patch('[dbo].[Delivery]',ThisItem,{Active:true})

I transitioned table over to CDS in order to take advantage of the attachment capability.  I created a two-option field to handle the boolean (yes/no).

However, when I reworked the functions to use new CDS table, I cannot seem to get that boolean to work.  I have tried:

          Patch(Deliveries_1,ThisItem,{Active:true})

but it gives me an error: " Invalid argument type. Expecting a optionsetvalue, but of a different schema."

I have tried replacing true with yes, "yes", "true"

 

Can anyone please tell me what I'm missing to make this work?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
lknudson
Level: Powered On

Re: boolean patch to cds

I found what I think I needed here, but it's not very straightforward.

 

https://www.youtube.com/watch?v=pj7AJy_UVIw by Daniel Christian

 

I am kind of frustrated when some very workable, SQL compliant data types (e.g., autonumber for indexes and simple boolean data types) have been swept away and replaced by more complicated and obscure elements in CDS.

 

View solution in original post

2 REPLIES 2
Highlighted
lknudson
Level: Powered On

Re: boolean patch to cds

I found what I think I needed here, but it's not very straightforward.

 

https://www.youtube.com/watch?v=pj7AJy_UVIw by Daniel Christian

 

I am kind of frustrated when some very workable, SQL compliant data types (e.g., autonumber for indexes and simple boolean data types) have been swept away and replaced by more complicated and obscure elements in CDS.

 

View solution in original post

mcolbert
Level 8

Re: boolean patch to cds

This works for standard option sets, but how do you get the value of the Yes/No in a Two Option field type, it's not visible in the UI. Using the option set values using this syntax works for others; [@fieldname].'Option1'

 

Thanks

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

Users Online
Currently online: 341 members 2,950 guests
Please welcome our newest community members: