Dear Power Apps Community Members,
I'm a bit stuck with one part of my update screen.
I have taken all relevant data from a (SQL Server) table, in a collection (one row only). Displayed them in a Canvas App and OnChange of any of the displayed fields, updating the Collection. Finally if the user Clicks the 'Save' button the row will be updated.
Every other field is getting updated as expected. However my issue is with a toggle button.
The purpose of the button is to reflect the 'status' column in the DB Table which contains 1 or 0 (datatype: tinyint). It denotes whether the record is active or inactive, where 1 = active.

I have defined the Default value of the Toggle with:
If(First(CustRec).status = 1, "true", "false")
CustRec is the name of Collection. Falsetext = "Inactive", Truetext = "Active"
I'm a bit clueless how to update the collection value on the basis of the user clicking on the 'Status' toggle button to change the status of the customer (only when such a change is needed).
The OnChange value is:
UpdateIf(CustRec,
status = ThisRecord.status,
{status:If(Status_Toggle="true",0,1)
}
)
The idea is: if the value is 'true' or 1 now, Onchange it should be 0 else 1.
However this is not working! I have tried a few other options but they doesn't work either!
Any suggestion to the right direction will be really appreciated.
Thanks.
Ozzie