Forum Academy Marketplace Showcase Pricing Features

Update a field value depending on another field value

Hi,

I need to know if is it possible to change/update the value of a field (“Status” field) on a database conditional to another field (“End Date”) in the same data type? For example, if current date/time is > “End Date”, run a workflow to update the value of “Status” field.

Thank you

If you mean as a conditional in a workflow, yes you can do it just as you outlined above - i.e. run a workflow to change the status, but only when the current date is greater than the End Date value.

If you mean you want the Status to change automatically ‘when’ the current date/time becomes greater than the End date, then schedule a backend workflow to run at the End Date to change the value of the Status field.

Yes, I need it to be automatically so it would have to be a backend workflow. How can I do this? Any idea?

In that case here’s what you need to do…

  1. In backend workflows add a new API endpoint, and uncheck the ‘expose as public endpoint’ box.
    You’ll need to add a parameter of the type ‘whatever datatype it is that you want to change the field in’ - unless it’s a ‘user’ datatype, in which case you don’t need to use any parameters.

  2. Add a single action in the workflow to ‘make changes to a thing’ and select the type of thing to make the changes to…

If its a user just select ‘current user’ and if it’s something else then select the name of the parameter that you added in the first step.

On that action, click to add another field and select the field ‘Status’, and enter that value you want to it change to.

  1. Then you just need to schedule this workflow to run on whatever thing it is you want to change, at the date/time stored in that thing’s ‘End Date’ field.

The most likely way you’d want to do that (although it depends on how your app works and how it’s set up), would be to do that in the same workflow that set the ‘End Date’ in the first place.

So wherever that workflow was, after you set the End Date, in the next action schedule the API workflow to run on that thing, on the date/time of that end date.

Then, once that End Date is reached, the workflow will run and change the status field to whatever value you set in the workflow.

It sounds more complicated than it is, but have a go and see how you get on.

Thank you! It works perfect.

1 Like