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

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
Advocate II
Advocate II

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
Advocate II
Advocate II

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

Advocate IV
Advocate IV

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (7,499)