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

Patch a CDS option set from canva app

Like (0) ShareShare
ReportReport
Posted on 28 May 2020 14:23:00 by 39

Hi

 

I'm trying to patch a CDS option set from my Canvas app using a button. 

 

The CDS entity is called 'alerts' the field is called 'Level" and the option set is called 'qrs_alertstate'. Alertstate has a few values; Critical, Warning and OK. 

 

for the life of me I can't get this to update. Here is my code: 

 

Patch([@Alerts], ThisItem, {Level : 'Level'.Okay})

 

can anyone help? 

 

thanks in advance

 

 

 

Categories:
  • Dr_David_Banner Profile Picture
    39 on 29 May 2020 at 08:20:41
    Re: Patch a CDS option set from canva app

    @v-siky-msft 

     

    Amazing, thank you very much, that's really helped me out 🙂 

     

     

  • Verified answer
    v-siky-msft Profile Picture
    on 29 May 2020 at 08:15:53
    Re: Patch a CDS option set from canva app

    Hi @Dr_David_Banner ,

     

    Yes, that is the problem.

     

    The Option Set Name is Alert State, the code should be:

    Patch([@Alerts], ThisItem, {Level : [@'Alert State'].'Okay'})

    Hope this helps.

    Sik

  • Dr_David_Banner Profile Picture
    39 on 29 May 2020 at 08:08:25
    Re: Patch a CDS option set from canva app

    sure: 

     

    image.png

     

    thanks

  • v-siky-msft Profile Picture
    on 29 May 2020 at 08:05:14
    Re: Patch a CDS option set from canva app

    Hi @Dr_David_Banner ,

     

    OK, What is the Option Set Name (Not the Option Set Field Name)?

    Could you please share the Option Set Field property shown as below?

    Snipaste_2020-05-29_16-03-34.png

    Sik

  • Dr_David_Banner Profile Picture
    39 on 29 May 2020 at 08:01:34
    Re: Patch a CDS option set from canva app

    thanks for your suggestion, this is what I get:

     

    image.png

     

     

  • v-siky-msft Profile Picture
    on 29 May 2020 at 07:52:50
    Re: Patch a CDS option set from canva app

    Hi @Dr_David_Banner ,

     

    Could you please try this? The option set also need to marked by a disambiguation operator

    Patch([@Alerts], ThisItem, {Level : [@'Level'].Okay})

    Hope this helps.
    Sik

  • Dr_David_Banner Profile Picture
    39 on 28 May 2020 at 18:33:36
    Re: Patch a CDS option set from canva app

    I think the problem, for whatever reason is it can't find qrs_alertstate ? 

  • Dr_David_Banner Profile Picture
    39 on 28 May 2020 at 15:52:46
    Re: Patch a CDS option set from canva app

    image.png

  • eka24 Profile Picture
    20,921 on 28 May 2020 at 15:49:57
    Re: Patch a CDS option set from canva app

    Please give a screenshot

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Dr_David_Banner Profile Picture
    39 on 28 May 2020 at 15:38:48
    Re: Patch a CDS option set from canva app

     

     

    the message I get is "function lookup as some invalid arguements" 

     

    the name isn't valid, this identifier isn't recognised" 

     

    Thanks

     

     

     

     

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete