Reset input value after a certain time

I use a pick list of work status using a valid if statement. I also have a computed initial value and edible if statement.

When the computed initial work status value is “Assigned” work status become editable. I want to add a “Check Out” work status option when the start hiking to find and clean graffiti in the forest. This is to prevent others from hiking to the same place. But after 12 hours I want “Check Out” to revert to “Assigned”. This is to prevent people from blocking work using Check Out.

Is this possible?

0 6 1,173
6 REPLIES 6

You could achieve this through the Reports (i.e. scheduled rule) feature.

Do the following:

  1. Create a new DateTime field which you set to NOW() when you set “Status” to “Checkout”. You might call that field “CheckOutTime”.
  2. Create a Report that invokes a DataChange action that sets the “Status” field back to “Assigned”. The DatAChange Condition would invoke this action when AND([Status] = “CheckOut”, NOW() - [CheckOutTime] >= 12)
  3. If you want to run the Report every hour, you will need to create a total of 24 copies of the Report, each scheduled one hour apart. If it was sufficient to check every two hours, then a total of 12 copies would suffice.

Sometimes you can solve this kind of functionality also with a virtual status column. The normal colum is still “Check Out”, but the virtual column will show you “Assigned” if the update has happened 12 hours ago. Of course it depends what you need to do with the status after that 12 hours. If you need to do something with it, then answer from @Phil is better approah.

Very cleaver idea Aleksi! I had not thought of that approach.

Thanks. This worked for me, but required a plan upgrade so I dropped it.

@Fof_Webmaster - depending upon what you are using for your back-end (eg: google sheets), you could also consider handling this with google scripts. Script uses a trigger to check “Check-Out” older than one hour and re-sets back to “Assigned”.

I would try and use as much native Appsheet capability as possible because keeping track on who is the master of changes (Appsheet or google) can get confusing and create unplanned for results, but it is an option. Record level changes handled by Appsheet, and database level changes handled natively on google back end.

Just another option — now you have three approaches. I suggest using the google script approach only as a last resort…

Thanks. I solved this by not resetting work status. In stead I use 2 format rules that change the map marker picture if NOW() - [Date] > “24.00.00”

This works for us because letting people know is sufficient and a hard reset isn’t required .

Top Labels in this Space