How to change an a status when a deadline date has passed

im trying to change a status of a case when the current date hits the deadline date.

i have tried doing that in a backend worklfow but i seems that it just change the deadline date to current date and not the status… can anyone help me out with this one?

Create a backend workflow which changes the status, and schedule it to run on the dateline date.

(you can’t do this with a database trigger as there’s nothing changing in the database to trigger it)

im not sure i understand what trigger to use…?
can you be more specific?

You don’t use a trigger… you just schedule it when you create the thing.

hmm…

so in my workflow of create a thing it gets created with a “tilbuds staus” called “sendt”
and a “udløbsdato”/deadline date chosed from a date pickers value when creating

when current date then hits the dealine date i want the “tilbuds status” to change from sendt to experied

im still not sure i understand where or how to schedule that to happen…?

I’m still fairly new to Bubble, but I think Adam means this:

You just need to schedule the backend workflow to run on the udløbsdato

Obviously, have a condition on the backend workflow itself, so that it only runs if the Status is sendt.

i still didnt understand out from what you wrote how to make a scheduled trigger…
but i asked bubbles AI bot there got me a tiny bit closer…

it tells me to make an recurring event and set the frequency to check daily
but as you can see here i dont get the option to set a frequency in a recurring event nor either point 3: “set/cancel a recurring event”

so im still lost what excatly to do…
i see to use the schedule API workflow i will have to upgrade my plan before i can start playing with that… and that is to early yet to do

Well that’s a totally different approach to what I was suggesting (but is an alternative way to do it, although probably not ideal for your specific use case).

Personally I’d recommend doing what I said previously rather than this method here, but it depends on your specific requirements.

To change the status of the Tilbud when its deadline is reached, you should schedule an API workflow to run on the deadline date. To do this, you should:

  1. Create a Backend workflow called “tilbud_status_update” (or name it as you wish) and add an action to it “Make changes to Tilbud” with status update. Add to it “Tilbut” data type as parameter. You should put a condition on this workflow to run only when the Status is “sendt”.
  2. When creating a new Tilbud and you know the deadline date, you should add the next step to this workflow which will be “Schedule API Workflow tilbud_status_update” and in the Scheduled date field, put your deadline date. In Tilbut param it will be this workflow Tilbut. It is good practice to save this API workflow ID (inside the Tilbud object) to be able to cancel it if needed.
1 Like

in the “make changes to tilbud” action in point 1. should that be “tilbud now” or “tilbud before changes”

The Backend API Workflow from point 1 should be “New Api Worflow” type. No “New database trigger event”.

so like this?
doesnt it become a issue when search for item is set to first item?
and cant chose tilbudsstatus value as a condition either

By this you will have an access to the client side created Tilbud without need to search for

now we are getting somwhere! :smiley: and thank you for the tip with parameter… didnt know that…

i still have this parameter field the need a expression… what should that be you said?

Step 1 result I guess

amazing! thank you so much for a good guide to do that… i assume i catn really test it yet before i upgrade my plan?

Every Scheduled workflow can be seen in Bubble editor under Logs>Scheduler and then “Show”.

oh okay… thank you again… :slight_smile:
now i just need to figure how to setup a mail sending workflow… and the “tilbud” part is done…
so still way to go :laughing:

you welcome. Please mark this How to change an a status when a deadline date has passed - #10 by marpas as solution so others can easily find it