My app is a job board and I have the following 2 fields on every job
- Status - Expiry date
The status field is a text field that would normally be set to “Live”. I would like this to change to “Expired” when the expiry date is reached. I figured this would require an API workflow so I’ve setup the following but it doesn’t work.
One possible problem you may have is that an app on the Hobby plan doesn’t allow schedule API workflow, although you can get API workflows running other ways.
You might be interested in altering your app so that the status field is calculated on display instead of stored, so you don’t need to have anything altered on a schedule.
By not working I mean that the “Status” field is not changed to “Expired” when the Expiry date passes. I’m on a paid plan.
I like the sound of the status field being calculated on display as you suggest, but unsure how this would work exactly? How would I go about implementing something like that?
Some things to check:
. the server logs to see that the endpoint was invoked.
. the conditions that the database step is to be run.
. the search criteria matches the record you want changed.
An element could display a dynamic expression with something like expiry date < current date :formatted as, yes: expired, no: live
Or the Conditional tab of an element could be used with a similar date comparison, to alter various properties of the element.
I find the tiny font on the screenshots hard to read.
The endpoint definition looks okay.
The first step in the API workflow is scheduling the same workflow to run on the expiry date. You probably don’t want to do this, you probably want to schedule the endpoint to run from a different workflow, for example from a page button workflow.
Thanks for this. I felt like that 1st step must be wrong.
The problem is that I want the workflow to automatically run when the expiry date is reached. I suppose I could use a button on an admin-only page that I could click once a day to run the workflow on all jobs. Would that be a reasonable solution?
The batch" process has less schedules, but runs a search. It bunches the work into one time slot, which can be good to move workload into a time when few users are online, but is worse if user activity is spread across the 24 hours.
You’ll also need to consider whether the time component matters, and user vs batch timezones, it can make the difference of one day in expiry.