Hi @pal95 ,
Do you want to change a field's value everytime you click the button by using variable?
Please notice these points:
1)Variable value will restart every time you reopen this app. It will be blank when you start the app. How do you set this variable at the beginning?
2)What does valfacility represent? how do you set? The second parameter of Patch function should be an existing record in the data source.
I assume that valfacility is a record that you set as variable.
If so, you should set like this:
1)set the app's OnStart:
Set(ValFacility,LookUp(FacilitiesList,....));//set a record as this variable, please fill in condition in the ... part
Set(ValTask,
Not(ValFacility.Install="Done"),"Install"
ValFacility.Install="Done"&&Not(ValFacility.'Raise or Lower Flygt Ball'="Done"),"Raise or Lower Flygt Ball",
ValFacility.'Raise or Lower Flygt Ball'="Done"&&Not(ValFacility.'Modify for failsafe
operation'="Done"),"Modify for failsafe
operation",,
ValFacility.'Modify for failsafe
operation'="Done"&&Not(ValFacility.'Install IS Barriers'="Done"),""Install IS Barriers",
ValFacility.'Install IS Barriers'="Done"&&Not(ValFacility.'Fix IS Barriers'="Done"),"Fix IS Barriers",
ValFacility.'Fix IS Barriers'="Done","All is Done"
)
//you need to set this variable's value based on data base every time you open this app
3)the button's OnSelect:
If(ValTask="InStall",Patch(FacilitiesList,ValFacility,{Install:"Done"}),
ValTask="...",Patch(FacilitiesList,ValFacility,{...:"Done"}),
ValTask="....",Patch(FacilitiesList,ValFacility,{...:"Done"}),
ValTask="....",Patch(FacilitiesList,ValFacility,{...:"Done"}),
ValTask="....",Patch(FacilitiesList,ValFacility,{...:"Done"}),
ValTask="All is Done",Notify("This task has been completed!",NotificationType.Warning)
)
//update data source based on variable value
Best regards,