I would like to create an iterator that iterates over a fixed number, for example, 10. The first iteration result is 1; the second is 2, and so on. After the iterator reaches 10, the next iteration result is 1 again.
that’s the repeater module, but when it reaches 10 it will stop. So you need stacked repeaters so when one reaches 10, then next one increments so the first one goes back to 1. You are still limited by the second repeater then.
Might I ask what the use case is and what the end goal is? You can repeat this infinitely anyways.
I am curious about this as well. Like the other answers have stated you will need multiple repeater modules and maybe a variable module for the counter. The big question to ask if when will the iterator stop?
My guess is that you will have to have some sort of router or filter that checks a condition then runs the Repeater step 10 times and then re check a variable and if that variable is not matching repeat this step another 10 times.
The best way I can think to accomplish this is to basically have your finishing variable(the one that is unknown) be defined by a Set Variable module before your desired repeater. Then add a router with two paths. In the first path add a Repeater module mapped within the variable you set up in the variable step. After that add another Repeater module to repeat 10 times. Continue to do whatever action you think you should take, then before you exit that second repeater update the value of the First variable to the new value that may end the big loop, add a filter in between to make sure the iteration from the inner loop is the last. That should help. Finally in the second route you can add(if necessary) whatever steps you want to take after the whole iteration is over. Consider adding a filter in between routes to see if you can have more control over when each path will run.
The best approach for me is to use an infinite loop. However, I wasn’t very precise in my previous description, so I’d like to provide some additional details.
Each scenario run increments a value by 1. After starting the eleventh scenario, the value resets back to 1 again.
I intend to use this value to select a category from a Google Sheets table.
Thanks for the clarification, in that case, this is not an infinite loop.
What you need is a persistent counter that cycles from 1 to 10 across scenario executions.
In Make, this requires state storage, because each scenario run is stateless by default.
Recommended approach: Data Store
• Store a counter value in a Data Store
• On each scenario run:
Read the current value
Increment it by 1
if value = 11, store 1
This approach is reliable, explicit, and easy to maintain.
If you do not mind starting from 2 (or manually incrementing the increment module 9 times to “prime” the next run to be 10), then
you can use the Tools “Increment function” module —
Returns a value of 1 after first run. Every subsequent run will increment the returned value by 1.
e.g.:
The counter value is {{(i % 10 + 1)}} Make Input Markup: Copy-paste the above into the field, including start/end curly brackets for it to import as intended
Replace i with the variable from the increment module.
This formula will produce 2-10, then 1-10 (repeatedly).
If you do not want the 2-10 bit, then manually run only the increment module 9 times to “use” numbers 1-9, so that the next full scenario run outputs 10.
Module Subflow Export - paste modules into your scenario
Copy and paste this into the scenario editor to import the example modules shown in my screenshots above.
{"subflows":[{"flow":[{"id":1,"module":"util:FunctionIncrement","version":1,"parameters":{"reset":"scenario"},"mapper":{},"metadata":{"designer":{"x":2737,"y":-2293,"name":"Counter"}}},{"id":2,"module":"util:ComposeTransformer","version":1,"parameters":{},"mapper":{"value":"The counter value is {{(1.i % 10 + 1)}}"},"metadata":{"designer":{"x":2980,"y":-2290}}}]}],"metadata":{"version":1}}
Need help❓View instructions ◀
1. Move your mouse over the line of code above.
Copy the JSON by clicking the copy button on the right-side:
2. Enter your scenario editor. Close any open panels by pressing ESC. Press CTRLV (paste keyboard shortcut for Windows) to paste directly in the editor.
3. Click on imported modules and re-save it to trigger validation. There may be some errors prompting you to re-map some variables and select connections.
Note: Did you know you can also reduce the size of blueprint exports and module subflows like the above, using my Make Blueprint Scrubber?
While this may work, this is terrible advice, because it uses double the number of necessary operations. Do not do this.