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
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
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
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.

Users Online
Currently online: 167 members 5,599 guests
Please welcome our newest community members: