I have a scenario in Make like this to create a google slide presentation.
Now the template that I use to create a Google Slide has three rows on a slide. So if the values from previous modules are multiples of 3, then the slides are created without any issue. So if there are 3 values, I will have 1 slide. If there are 6 values there will be 2 slides and so on. However I do not want to restrict to multiples of 3 and want to handle any number. So if there are 7 values I want 3 slides to be created such that the first two slides have the 6 values and the last slide has just 1 value. Suppose I manage to have a template for 2 values and 1 value as well, how can I handle the script such that at the end, I have only a single presentation?
With the current setup as shown in the image above, I am unable to handle this as any value not a multiple of 3 will lead to blank parameters and hence they give the missing parameter error. How can I handle the influx of any value in the script and generate the slides dynamically?
Would something like this (router within a router) work? So something like this
if (there is 1 value) – use the first template
if (there are 2 values) – use the second template
if there are 3 or more than 3 values
then
if (remainder of (no.of values)/3 = 0)
then use repeater with template 3
if (remainder of (no of values/3) = 1
then use repeater with template 3 and then add template 1 separately
if (remainder of (no of values/3) =2
then use repeater with template 3 and then add template 2 separately
Or is there a simpler way?