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
Solved! Go to Solution.
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
Try:
Patch([@Alerts], ThisItem, {Level : LookUp(Level, qrs_alertstate="Okay")})
------------
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.
the message I get is "function lookup as some invalid arguements"
the name isn't valid, this identifier isn't recognised"
Thanks
"
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.
I think the problem, for whatever reason is it can't find qrs_alertstate ?
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
thanks for your suggestion, this is what I get:
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?
Sik
sure:
thanks
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
192 | |
52 | |
41 | |
39 | |
35 |
User | Count |
---|---|
261 | |
86 | |
71 | |
70 | |
66 |