Reference the option set by name rather than by its numeric value, so the formula survives a change in the underlying table.
Patch(
Orders,
ThisItem,
{
Status: 'Order Status'.Approved,
ApprovedBy: User().Email,
ApprovedOn: Now()
}
)Note
Quoting the choice column name and dotting into the value keeps this readable and refactor-safe. Hardcoding the integer works until someone reorders the options.
- Power Apps
- Power Fx
- Dataverse
