Hi there, is there a native capability yet that would allow you to execute a trigger n-times? E.g. to populate an array with some placeholders that the user then completes one after the other…?
In the meantime I have reverted to a custom widget that get’s the job done.
getValue("Count", (i) => {
if (i)
for (let ii = 0; ii < i; ii++) {
fireEvent("Execute", ii);
}
});
For arrays you can build an empty step → on step enter → if array not blank → pop from array do what ever you want with your value you popped from the array
→ go to step → itself
If Array is blank → go to step → next or previous or so… just exit the loop
The amount of loop cycles is limited! Don’t use this on to many repetitions
From the Tulip side, I think this is something that will be made possibke natively with looping in Automations - that feature is coming very soon (likely in a couple months). I will follow up here once that is released as well
Hello Beth, i think you are talking about a very different use case here when referring to automations… that is unless there is an intention to make these automations callable from an app directly. But from a structure point of view I am afraid this would become extremely messy quite quickly as you offload/burry pieces of your logic into a different module within the Tulip platform. Maybe just my opinion.
Say I have a form which I know well in advance that I will have to fill in n-observations. I what to give the operator feedback on what is needed, how much, and what he has entered so far.
In this context hardcoding the inputs will not get you the desired outcome. You will need to find a way to pre-populate your placeholder variabel with somethign that can then be augmented by the operator input.
This is where the loop comes into play.
In this particular example where the widget is going to be used:
Clear the object variable and read out the necessary loop count → “Before” trigger
Iterate through the loop and fill the object with the placeholder data
Notify the operator that he is expected to start filling in his observation → optional, just for illustration “After” trigger