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 / Help with Patch a new ...
Power Apps
Unanswered

Help with Patch a new record to Booking Alert Entity

(0) ShareShare
ReportReport
Posted on by 67

I'm trying to patch a new record to the OOB booking alert entity.  There's an custom optionset that specify which type of booking alert (ie. notes, photo etc). 

When I use this formula: Patch('Booking Alerts', Defaults('Booking Alerts'), {'Booking Alert Type': 'Booking Alert Type'.Note, Subject: Note_Subject_TextInput.Text})

it gave me this error. 

yichingjc_0-1601660122234.png

I'm not sure how to resolve. Please help. 

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @yichingjc,

    What type of control 'Booking Alert Type'? To update optionsets, you'll need to set the integer value of the optionset item. Here's an updated sample of your code. I'm assuming you're using a non-global optionset and getting the optionset value from a dropdown:

    Patch('Booking Alerts', Defaults('Booking Alerts'), {'Booking Alert Type': LookUp(Choices('Booking Alerts'.'Booking Alert Type'), Value = Dropdown1.Selected.Value).Value, Subject: Note_Subject_TextInput.Text})

     

    Hope this helps

  • yichingjc Profile Picture
    67 on at

    @EricRegnier 
    Thanks but I don't think thats correct. You are supposed to patch CDS optionset like this (see screenshot).  I think my issue isn't the optionset, its the Owner Field and I know it is a User. I'm not sure how to patch that...When I tried Owner: First(User()) it still gives me the same error. 

    yichingjc_0-1601905089919.png

     

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Could be, there are different ways to patch option sets and also depends on the connector used. It's very possible the issue can be with the Owner field. Can you please share your updated patch again as I don't see the Owner getting patched in your original one. Cheers!

  • yichingjc Profile Picture
    67 on at

    @EricRegnier  
    I tired patching this - 

     

    yichingjc_1-1602003737509.png

     

    But that still gave me the same error at the beginning. The given key was not present in the dictionary. I wish it can tell me more.....

     

    I also tried - setting a variable for the owner field as I know its USER (polymorphic lookup)
    I set the variable to be onVisible of the screen = Set(varUser, First(Users).User)

    yichingjc_2-1602003971584.png

     

    Patch('Booking Alerts', Defaults('Booking Alerts'), {'Booking Alert Type': 'Booking Alert Type'.Note, Subject: Note_Subject_TextInput.Text, Owner: varUser})
    It still gave me error below -

    "The type of this argument '_ownerid_value' does not match the expected type 'Polymorphic'. Found type 'Guid'."

     

    Tagging - @Shanescows  Hoping you can shed some light in this. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard