Forum Academy Marketplace Showcase Pricing Features

Recurring hourly restrictions

I know there’s a lot of posts about recurring date/time objects for scheduling.

I am however curious if anyone has a good way to program a recurring hour-only schedule.

Example:

My app is a campaigning app, for SMS and emails. I want the user to be able to set a stop and start time for their campaigns. So my app won’t schedule an SMS or email to be sent during a recurring hourly block, not relative to the date.

I am having issues with this since all times are tied to dates, even ranges. So if I set an initial range that encompasses the hours that are not allowed i.e. March 23 @ 1930 to March 24 @ 0830, as soon as the day passes it will be a moot expression.

I need a way to at the end of every day reset the time group relative to the current date.

I feel like this is pretty simple and I’m overlooking a function but any input would be appreciated.

It is simple: You just construct the dates you need for any given calendar day.

How do you construct a date in Bubble? You reference Current Date/Time… the only date we have a handle on really in vanilla Bubble (there are of course other ways, but not in vanilla).

You do this by just taking that date and changing all of its components to be the components that you need.

User says:

Don’t send email between Noon and 3.

On any given day, the dates (dates are unique points in time, mind you) to prohibit email sending are:

Current Date/Time:set hours to 12 :set minutes to 0 :set seconds to 0 <-- Noon on that day

and

Current Date/Time:set hours to 15 :set minutes to 0 :set seconds to 0 <-- 3 PM on that day

I’m simplifying a bit as of course manipulating dates has other pitfalls… But you can learn about dates in Bubble (and really what I’m talking about here is dates in JavaScript/the web/the browser, but it’s all the same thing):

1 Like

Thank you, I do understand what you mean about referencing from current daye/time… but what do you suggest to enable this as a recurring function every day though?

Exactly what I said: [quote=“keith, post:2, topic:83066”]
On any given day, the dates (dates are unique points in time, mind you) to prohibit email sending are:

Current Date/Time:set hours to 12 :set minutes to 0 :set seconds to 0 <-- Noon on that day

and

Current Date/Time:set hours to 15 :set minutes to 0 :set seconds to 0 <-- 3 PM on that day
[/quote]

If you want a recurring workflow to run, you set that up as a recurring backend workflow (paid plans allow various numbers of these). That would be the easiest way. There are other ways, but they involve more complexity.

(Apologies if I didn’t understand that this question wasn’t about dates, but was about recurring workflows, but it seems like it’s about dates.)

1 Like

Okay, I think I fully understand now and I did not the first time. I do appreciate your time to help me out and I know you’re very active on here discussing dates in general.

I know what I need to do now and that’s thanks to you.

Also, the question was about how to make it a recurring flow, but I think because I didn’t understand how to use the :set function properly which makes it a LOT easier, so I guess it was two pronged after all.

Thanks again! Hope I can return the favor some day.

1 Like

For anyone looking to do this in the future, here’s how I have it setup and it works like a charm.

The workflows are in order of the pictures.

The parameters are really a unneeded since I decided to just add the data to my campaign data type so that it can be saved… I ended up just sending the campaign through the parameter and calling that data… but you could do purely with parameters if you wanted to.

3 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.