Action to revert back to 'previous' state

There is a status column (enum) with values, say, “Live”, “Dead”, “Ongoing”, “Done”, “To be done”.

There’s always a default value for it, say ‘Live’.

There are actions to mark the column with values.

Say there’s an action named ‘Mark done’ that sets the column value to ‘done’, from its current state, say ‘Ongoing’

Can any action be defined that would revert back to the previous state; in this case, to ‘ongoing’?

You can use this:

[_THISROW_BEFORE].[STATUS]

Not particularly. I believe the _before only has access to the information from the same action so if you changed it to done and then “exited” the action there is no record of the ongoing status.

2 Likes

You would have to implement this yourself; there is no built-in way to do it.

1 Like

I was hoping that you would enlighten me with possible ways of doing that :smiley:

Please explore if following helps. You could possible have an action called “Previous” with an action icon such as ( <-- ) and action’s “Set this column” expression that sets the [Status] column to previous state with an expression like

IFS([Status]=“Done”, “Ongoing”, [Status]=“Ongoing”, “To be Done”)and so on.

The display name for this action could be

IFS([Status]=“Done”, "Ongoing <-- Done ", [Status]=“Ongoing”, “To be Done <- Ongoing”) and so on. So the action name always displays current status and previous status that the action will take to on tapping it.

Of course , there may be some other dependent logic in your app that you may need to implement, in “this action is available for only those rows” setting. This will be needed to ensure a totally free movement to previous status is not possible, say when the final status “done” is signed off.

A sample below

the action with -> icon takes to next status and the action with <-- takes to previous statuses in sequntial manner.

image

2 Likes

column named previous status and when you set the row to a new status you set this value to be the previous status

1 Like