I have googled all over the place, watched videos etc and I'm just not getting this to work. I can't even find the optionsetvalues because there are no elipses in the field info box to click like most of the explanations on line say to use. I followed Daniel Christian's video on this topic with option sets and dug into the dynamics admin menu and found the field but even there, there's no edit button for me to look at the actual values. I've tried using 0 and 1 but powerapps tells me it's the wrong data type. Is this futile? I guess I could just use custom columns for what I'm trying to do but this seems like it should be very very straight forward. Thanks in advance.
Sorry. I have to retract that statement. The "monitor" page indicated that a particular Patch() statement was getting an error so I thought this was the case. But it was actually a problem with a different Patch() statement than the one monitor highlighted. Misleading. Anyway, it does work.
I'm pretty sure that Canvas Apps can no longer do this. I've tried every conceivable way with Patch(). Not sure when exactly they changed it, but I think if you try your code above, you'll get errors setting statecode and statuscode.
I gave up on using the status column for what I was trying to do and just made a custom two option column. What I'm doing with it is fairly simple...make a templatefill flash or not flash. The status column, given its complexity, seems like killing a bug with a sledgehammer. Thank you for your help though.
You can set the default status using the Defaults() function in your patch.
Patch(Accounts, Defaults(Accounts), {name: "Account Name"})
If you are trying to explicitly set the Status, you may need to consider:
Create and then Update Status (using Account in CDS, as example)
UpdateContext(
{
locAccount: Patch(
Accounts,
Defaults(Accounts),
{name: "Inactive Account"}
)
}
);
Patch(
Accounts,
locAccount,
{
statecode: 'Status (Accounts)'.Inactive,
statuscode: 'Status Reason (Accounts)'.Inactive
}
)
mmbr1606
22
Super User 2025 Season 1
stampcoin
17
ankit_singhal
11
Super User 2025 Season 1