"change date (day) to" a list of things

Hi all,

So I have an app which has a few different routes which bus drivers use- its exactly the same drop off and pickup times when they complete a route- so drivers simply select a day and their established list of dropoff and pickup times copy over to the newly created route- but on the new day. This means on the data type I need to make changes to a list of things, and change the date, but NOT the time of each stop.

I can see there is the perfect workflow action called change date (day) to which changes the date but no the time of an individual date- however, this isn’t available to do to a list of things. I need a way to take the list of ‘stops’ and do the change date (day) to all of them while keeping their time. It seems like the perfect workflow action but I cant get it to change the date to the whole list.
Screenshot attached shows me changing data type ‘time’- the first attempt you can see the option to change date (day) to a single item in the list- but the second shows the workflow action isnt available when attempting to make the change to a whole list. (FYI, step 2 is ‘copy a list of things’ which is a list of the stops).
Screenshot 2024-07-09 at 11.53.21 am

To change the date for a list of ‘stops’ while keeping their time, you’ll need to loop through each stop individually using a “Schedule API Workflow on a List” action. This way, you can apply the “change date (day)” action to each stop in the list. Unfortunately, there’s no direct way to modify the date for an entire list at once.

Thanks mate, any chance you have an example of what that schedule api workflow would look like for it to go through each stop and change the date? Thanks

I think it’s a waste of WU for something so simple. I needed a break and decided to make a plugin for you as practice.

TCH - Change Dates Plugin | Bubble

It does what you want, take a list of dates and changes it to the new date. It’s a simple action that runs a simple function. I included a WF trigger for when the conversion is done.

Disclaimer, I do use AI to help me write code but it’s only because I cannot be bothered to remember keywords and methods.

Hey mate thank-you so much its exactly what I need. I cant quite get it to work currently.
The workflow looks good, in the step by step it works perfectly but its not changing the database. I placed the element on the page and then used the workflow action called tch. Am I missing something? Thank you
Screenshot 2024-07-09 at 5.58.25 pm

You’ll still need to run “make changes to a thing” and use the new dates from the plugin as the value for the list of dates you want changed.

To ensure that the plugin has completely run, you can run the “make changes to a thing” as an action in the “TCH - List of Dates Completed” event workflow.

Does that help?

I can see how to use the element action now and Ive saved the list of new dates as a state, I cant see how to “make changes to a list of things” and replace all the old dates with the new ones though.
Screenshot 2024-07-09 at 6.12.40 pm

Ah I misunderstood your original post a bit. I thought you wanted to change the field values of a list of dates of a Thing. If all you’re looking to do is change a single date but keep the original time all you have to do is write the expression as such:

image

New date, change hour to original date extract hour, change minute to original date extract minute.

hey mate I cant quite work that out, could I take a look at your editor? Ive never seen the command ‘change’ before
Screenshot 2024-07-09 at 6.48.34 pm

Sure thing.

coffeehat-sandbox | Bubble Editor

Thanks for sharing, in your example it looks like you are only changing a single date and a single time. I have a list of 30 times throughout the day and all of those seperate times need to have just their date changed but the individual times kept the same. From what I can tell you are extracting a single time. When i try to use the ‘change date to’ command it only works on a single thing not a list of things.

Any help would be so so much appreciated, thanks

Hey mate looks like this is my best option, im having trouble getting the workflow to work. My plan is to use the api backend workflow and like you said trigger it to run on the list. I cant get the workflow logic to allow me to change date too though.
Screenshot 2024-07-10 at 8.46.00 am

So Ive created a backend workflow which should use 2 states which are numbers to replace first the day, then the month of the dates without the time, however I cant workout why it wont run. Screenshots attached- How can i debug or test backend workflows like the step by step feature to diagnose the problem? Not sure where ive gone wrong. Ive tested the workfow logic on the page for a singular date and its worked, just don’t know where its going wrong when using the backend api which i need to use because I need it to run on a list of things.

Screenshot 2024-07-10 at 1.10.43 pm


Screenshot 2024-07-10 at 1.10.54 pm

I updated the plugin to include backend action. So you can create an API workflow that will take the current list of dates of the stop then change it all to a new date. Then just use the Schedule API WF on a list action, client side.

Try it out and I hope that helps. Look out for timezone differences.

Here’s a sample Schedule API WF on a list action. As you can see, make sure to add the necessary parameters.

Here’s the API WF

Here’s the plugin action in the API WF
image

Thank-you very much for the help- I have followed the above exactly, the only different is at the end screenshot you make changes to a thing after using the TCH change dates. For me, after the change dates I need to make changes to a list of stops. Does the TCH change dates actually make the change itself? Or do i need to use make changes to a list of things after it? I cant get the list of things option to work with the result of the TCH change dates workflow.

The plugin action only takes a list of dates (these include your time), runs some javascript to convert all the dates to a date of your choice, without affecting the hours and minutes. Then it outputs the new list as a list of dates. The plugin itself will not make changes to your data, simply put no plugin can do that.

So what you do is create an API workflow that takes a single stop as a parameter, then add 2 actions. My plugin action (which will convert the Stop’s current list of dates) and Make changes to a Thing (this will change a Stop ). In the fields to change your Times field (which I assume so far is a list of Dates) and set list to “Result of Step X’s new list” (this points to my action’s plugin.

To edit multiple stops you use a Schedule API WF on a list action from wherever.

Man I hate to make things difficult, but I have a list of things (stops) and each different thing has a date. So its not that each stop has a list of dates rather I have a list of stops who all have dates. With that being said I tried to use the plugin and then make changes to a thing as per my screenshot. I need to make changes to a list of stops, each stopss date.
Screenshot 2024-07-11 at 3.19.38 pm

So your Stop’s Time field is a single date value?

EDIT: If it is then you should have no issue accessing the change to date/hour/minute expressions and you wouldn’t need the plugin.
image

That has worked thank-yuou very much- your plugin has other uses in my app.

1 Like