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

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
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. 

Categories:
I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at
    Re: Help with Patch a new record to Booking Alert Entity

    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
    Re: Help with Patch a new record to Booking Alert Entity

    @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
    Re: Help with Patch a new record to Booking Alert Entity

    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
    Re: Help with Patch a new record to Booking Alert Entity

    @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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 803 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 314 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 253 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics