Set its function name to whatever you want. But I’d recommend index or countdown or something because what we’re doing is making a loop. (You’re going to trigger this thing with bubble_fn_whatever(some_value_to_send); )
Create an element or workflow that downloads all of your objects with the starts and ends to the page. For example, on page load set some custom state equal to do a search for all of those things. You could instead put an RG down that has that same source. Basically, you need a way to refer to the things by item number.
The workflow steps will do this:
Change the “duration” field to what you need. I’d recommend using the “date interval” type for your duration field as that’s exactly what date intervals are: time intervals, aka pure time measures, aka durations. Then the duration is This things end - this things start.
Congratulations, you just made a while loop in Bubble.
That’s it for the workflow.
Now you just need to kick off this countdown.
bubble_fn_whatever(Your list of things:count);
So what’s going to happen is you’re setting the JS to Bubble element’s value to the number of the last item in your list.
Doing that kicks off that JS to Bubble element workflow. It will operate on the last item in your list of things. The JS to B’s value is then decremented. That kicks off the workflow again. This time operating on the second to last item in the list.
And so it proceeds until the JS to Bubble’s value is zero and the workflow will not execute.
This is the general approach to iteration I’ve hinted at before but never fully described.