Repeat Step

Hi all, I’m still learning here and I know a lot of you have come from DMXZone with Dreamweaver (I haven’t).

Can someone explain the Repeat Step to me please? Is it like a while loop (while expression is true)?

Also, can someone provide some good, solid use-cases for this action?
My first guess was that if I wanted to mail every user in the database I’d query the database and then use a Repeat Step which would do the actual mail sending. If so, what is the expression set to? I may be completely wrong but hoping to learn.

Many thanks!

Hi Niall,
Yes, the repeat step is used to repeat some tasks on the serverside.
Usually these are database queries and your example is one of the use cases.
So, in order to send email to many users, add:

  • a database connection

  • a database query

  • repeat step

  • inside the repeat step add the mail action, all the properties of the query, which you are repeating will be available in the dynamic data picker, so you can bind them:

Another use case would be multi file upload + process, then you loop through the uploaded files and process all the images using the repeat step.

1 Like

Thanks for clarifying @Teodor.
That’s nice that you can just use the database query as the expression and it loops through the results accordingly. I also wasn’t aware that all of the query properties within the repeater are all then easily viewed via the dynamic data viewer, that’s pretty awesome.

Many thanks!

1 Like

The repeat also serves another purpose in server connect, subtle but important

If you need to access details of a query in a subsequent stage in server connect you must create a repeat on that previous expression expression which effectively “exposes” its content to the next step. This applies even if the query returns only 1 result. Confused me at first but makes sense once you think about it, the repeat works as a record pointer to the collection returned

3 Likes

That’s right Brian, thanks - forgot to mention it :slight_smile:

1 Like

Okay, that’s the killer feature right there - I was doing stuff like {{query[0].email}} and even using Set Value just to clean up the variable names that I’d then bind to. Now my actions list is shorter and everything reads much better. Many thanks @Hyperbytes

2 Likes