Create a thing at a certain time

Hello fellow bubblers.

I would like to do the following.

When on button is clicked, create a new thing at 7:00pm, with the value of yes

At 6:00am, create a new thing, with the value of no

I would like this to keep happening until you click the off button

Hi Will!

If you have access on your plan to recurring workflows, you can look into that.

If you don’t, here’s a way to tackle it which basically has an api workflow that reschedules itself until that is longer needed (the loop is turned off by the user.)

First you setup the api endpoint that accepts a yes/no (which represents your “value of yes” and “value of no”, along with the user that triggers this endpoint (I usually track the user apart from Current User just for clarity):

Step 1 is to create your new thing, using the status passed to the endpoint:

Step 2 schedules the next call for 6am on the next day (only if we have just run the 7pm loop):

Step 3 schedules the next call for 7pm on the current day (only if we have just run the 6am loop):

Step 4 sets the loop id on the user (which is used as the flag indicating the loop is “on” or “off”, and gives us a way to cancel the loop midstream):

Step 5 does the same as Step 4, but for the other loop:

Now, on the page with your button (I’ve set it up as a toggle) we take steps to turn on the loop if it is not already on:

Step 1 starts the loop (if needed for the current day):

Step 2 starts the loop (if 7pm has already gone by, and so it is needed for the next day):

Step 3 saves the api event id so we can cancel it:

Step 4 does the same as 3 but for the next day’s scheduling:

We then have the other side of the toggle, to turn it off:

Step 1 cancels the currently scheduled api event:

Step 2 removes the id from the user:

You will probably have more “what if’s” to build in and changes to match your exact needs, but this covers the basics of it!

Best of luck!

–Ken



Looking to accelerate your app development?

Development of Advanced Apps at https://uniqueideas.com or schedule a free intro session :gift:

Ken Truesdale
LinkedIn

1 Like

Wow! I appreciate that you took this time to explain this!

I will be working on this and I will be contacting you through this thread or DM whichever you prefer.

Thanks again!

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