Idea: start loop and end loop actions

I recently upgraded to Millau and was able to create a declarative loop by using reusable action sequences and branches.

The problem that I had to solve for was figuring out how to split multi-day calendar events in to n number of single day events based on the total span of days.

I used two reusable action sequences:
1) Creates a new row and specifies the field values (derived from a model that held the main event record’s values) AND
2) A branch action( logic: {{$Model.Multi_Day_Event_Split.data.length}} < {{EventDays}}) that ran reusable action 1 and then re-ran itself to loop.

As long as the branch remained true, the reusable action would continue looping.

*EventDays was a UI Formula field that calculated an events duration in days.
**Multi Day Event Split Model was a model w/ 0 records in it that would add one new record each successful iteration.

Reusable Action 1

Reusable Action 2

1 Like