cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MudzaffarMansor
New Member

Patch Column Option Set Type Error

Hi,

 

I am trying to patch a data in CDS, 

 

Patch(Inventories,First(Filter(Inventories,'Inventory Id' = ThisItem.'Inventory Id')),{InventoryStatus:"Available"} );Refresh(Inventories)

However, getting the error "The type of this argument InventoryStatus does not match the expected type 'OptionSetValue'. Found type 'Text' "

 

How do i patch the option set type? 

12 REPLIES 12
Avinoam
Frequent Visitor

I too am facing the same error of "expected type OptionSetValue. Found type Number" when trying to Patch an option set to CDS.

My scenario is - I'm trying to put together a shipment form made of a number items and one of the parameters of every product is its final destination (there are 3) which is picked from an option set (presented in the canvas app with radio buttons).

All items are collected in a local Collection (ShipmentitemsCOL) and once all is set – clicking a button (OnSelect) will trigger the Patch under Forall, and create/update the records in the CDS entity.

Now, this all works fine with text/number or even lookup fields, but an OptionSet…..

2.png1.png

Any help / hint will be very much appreciated.  🙏

I'm banging my head over this for three days and tried everything I could find but to no avail 😩

 

 

Hi @Avinoam ,

 

I found a solution for these option sets (It was working 2 weeks ago, before the update of the Power Platform 😆), so if you can try it and say me if the problem is solved, it will be great !

 

So please try to use the Dynamics 365 connector (Premium), so you will be able to pass true/false, integer and concateneted text instead of the Option Sets Values.

 

So my conclusion is that the connector for CDS is very useless

 

But what about Dynamics 365 Today ?

It is deprecated ?

 

Bests Regards,

Romain.

Avinoam
Frequent Visitor

I actually solved my problem by reverse engineering my app and found that my original input component which collected option set choice was not properly connected to the CDS option set and once that was fixed the patching was no problem. 

Your solution @Romsteck  may be a good one but as you yourself say the Dynamics 365 connecter is on its way to be depreciated (I told so by a Microsoft engineer).
anyhow, thanx for the answer and solution. 👍

BTW to the best of my knowledge the CDS connector is undergoing an extensive upgrade these days (Kepler project ?)

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,612)