Hi All,
I'm struggling to figure out how to patch a Choice column from a Grid (PowerFx) command. To keep it simple, I created a test App with a single table called 'Project' with a couple of columns, one of which is a Choice ('Started' or 'Finished') column.
I've created a Command to run from the Projects grid. It should patch the selected records changing the current Choice column (ProjectStatus) to 'Finished'.
I can patch the Choice column using ThisRecord.ProjectStatus (pointless I know) with no error, but I can't work out how to present a record object for the choice 'Finished' to update the ProjectStatus column.
Below is a screenshot of the error that is returned when trying to patch the ProjectStatus column in the Projects table.
What is the correct syntax to update the ProjectStatus column to reflect the new status of 'Finished'?
Cheers, Innes (NZ)
Hi All,
It turned out to be remarkably simple to get this Patch example to work:
Hi @Jmanriquerios ,
Thanks for replying. It's much appreciated.
It's unclear which column is being patched with the Choice value. Could you please highlight which part of the code snippet sets the patched Choice column in Control Financieros and from what source.
Thanks in advance. Innes (NZ)
Hi @innes_NZ
As an example, it happened to me, and until I found a solution
ForAll(
Self.Selected.AllItems As tblsPagoProfesor;
Patch(
'Control Financieros';
Defaults('Control Financieros');
{
Concepto: tblsPagoProfesor.Nombre;
'Tipo de Registro': 'Tipo de Registro'.Gasto;
'Tipo de Gasto': 'Tipo de Gasto'.'Pago de Profesor';
'Fecha Registro': tblsPagoProfesor.'Fecha de pago';
Monto: tblsPagoProfesor.Monto;
'Pago Profesores (jm_PagoProfesores)': tblsPagoProfesor
}
)
)
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473