Incrementally adding dates in a RG

Hello All!
I’ve been toiling with this solution for a few days now and, even with a few other forum solutions, I am still trying to figure this out.
I am using a DateTime picker to establish a starting date, with an added field to determine a duration for a certain task. I have figured out how to add the date and duration field to establish a finish date for the certain task.

What I can’t figure out is how to keep a running total of the durations to establish the next completion date for the next task.

For example: Task 1Start Date Jan 1, 2023
Duration 10 days
Task 1 End Date Jan 11, 2023
Task 2 Start Date Jan 11, 2023
Duration 5 days
Task 2 End Date Jan 16, 2023

[How do I aggregate the durations to keep the tasks in sequence?

Thank you all SO much…

Take the Start Date field and do :+(days) then pick the thing’s Duration field (should be a number field)

The Completion Date text can either do this calculation itself to show it on screen, or you can have some workflow trigger from when you edit either of the Start Date or Duration fields to recalculate it and store it in a Completion Date field.

Oops I just re-read and sounds like you have that handled already…

You mean you want it so no tasks “overlap” and editing one would push the other dates later?

Yes, that would be good. The key is to have the tasks sequence. Goal is to show a unique Completion (End) Date for each task, which is in sequence with the previous task. For example:
Task 1 Duration 1 day Start Date Apr 2 Completion Date Apr 3
Task 2 Duration 30 days Start Date Apr 3 Completion Date May 3
Task 3 Duration 21 days Start Date May 3 Completion Date May 24
etc… (note: the completion date will become the start date for the next task)
Thanks for looking at this! It seems pretty logical. Just can’t figure it out.

:thinking: It is a little tricky because Bubble is garbage at front end loops (for now). Since you need to process one item, then the next one relies on the previous one. @keith 's ListShifter plugin would probably help a lot with the ITERATE feature.

Otherwise you can do a recursive workflow to process one item at a time. I made a loop in the front end with two custom states but it’s not behaving properly cause I think they don’t want you to do it like that so it would need to be done in the backend…

1 Like

Tyler. thanks so much for helping me out. Yeah, I’ve tried a few work arounds. I’ll look into the ListShifter plugin.
I really appreciate your time and advice.
Regards!

1 Like

I was playing around with it some more, I’m assuming these tasks have an Order # field or something to specify what order they go in right? If they were ordered by date they would be jumping around if sometimes were overlapping by accident, etc.

Yes, the tasks are ordered in their respective field. Tasks will have an alphanumeric order and a duration. This will allow the end user to insert a task or edit the name and reflect a new order. (M1-01, M2-01, M3-01…)

Okay I solved the mystery:
Run mode: https://tylerboodman-test-app.bubbleapps.io/version-test/tasks?debug_mode=true
Editor: tylerboodman-test-app | Bubble Editor

1 Like

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