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,184
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