web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch Column Option Se...
Power Apps
Answered

Patch Column Option Set Type Error

(0) ShareShare
ReportReport
Posted on by 19

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? 

Categories:
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @MudzaffarMansor,

    Do you want to update the InventoryStatus column value (Option Set Value) of a record in your CDS entity using Patch function?

    Is the InventoryStatus column a Option Set type column or Multiple Option Set type column in CDS Entity?

    I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:1.JPG

    Set the OnSelect property of the "Patch" button to following:

    Patch(
    TaskLists,
    LookUp(TaskLists, 'Primary Name'="1002"),
    {
    Approve_Status: "Rejected" /* <-- Approve_Status is a Option Set type column in my Entity*/
    }
    )

    Please check if you have provided a proper value for the InventoryStatus column in your Patch formulaIn other words, the value you provided must has been existed within the available values list of your InventoryStatus column.

    Please also take a try to enable the "Use the Common Data Service experimental connector" option within Advanced settings of App settings of your app, then re-load your app, check if the issue is solved.

    In addition, please take a try to re-create a new app on your side, then try above formula again, check if the issue still exists.

    If the issue still exists, please consider submit an assisted support ticket through the following link:

    https://powerapps.microsoft.com/en-us/support/pro/

     

    Best regards,

    Kris

  • MudzaffarMansor Profile Picture
    19 on at

    Thanks for the reply. I did tried on blank canvas and seem having same issue.

    Screenshot 2019-01-01 at 10.56.45 AM.png

    Screenshot 2018-12-31 at 4.50.42 PM.png

     

    I also include video showing how i did the canvas app from scratch.

    https://1drv.ms/f/s!Ag7iOfP4OCz_uS9M1jFIDfR0CNo1

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    adding in @CarlosFigueira to review and assist. 

     

    @Anonymous

  • Verified answer
    MudzaffarMansor Profile Picture
    19 on at

    Hi,

     

    I have resolved the issue. It seems most of the reference and documentation does not updated. I have resolved it by putting the code like

    Patch(Inventories,First(Filter(Inventories,'Inventory Id' = ThisItem.'Inventory Id')),{InventoryStatus:InventoryStatus.Sold} );Refresh(Inventories)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Am developing canvas app with gallery , where on click of a button i want to update the optionset value of the selected record. For that am using the "onselect" of the button as below. How you people are taking Inventorystatus in your sample. Note:"new_status" is my optionset field.

     

    Patch(entityA, ThisItem,{ new_status:"XXXX" });ModelDrivenFormIntegration.SaveForm();
    
    
    

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    How you are loading inventorystatus values here 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am currently experiencing the same issue !! I incur the type error whether I grab from a collection or hard code the option ?? 

     

  • Romsteck Profile Picture
    83 on at

    Up !

     

    Any solution to do that ?

     

    Thanks 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This took some working out........ Define a link in the patch to the Option List Column. e.g.

    patch(TableName,Lookup(Record1),{OptionList:[@OptionList]."Option1"});

    This will add "Option1" to the Column "OptionList" for Record1. The key is the [@OptionList] syntax.

  • Avinoam Profile Picture
    53 on at

    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 😩

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard