How to repeat a returned record - say 10 times - The wappler way?

I have a simple query. It returns 1 result.
But what i want to achieve - i want to “repeat” that single query on my page multi-times.
Would it be best to done via Server Connect or Client Side?

The method behind the madness is I have 1 result but … needs to be duplicated x-amount of times.

1

So it returns a single result
2

3

so the end result must be something like this…
id:35-0 -----> id:35-($index value)
id:35-1
id:35-2
id:35-3

id:35-10

I have used while and repeats within the while… but i cannot for the life of met to get it right. Im sure im overthinking this stupid thing again.

I used PHP before. eg. For loop.
4
Just to give you an idea what im after…

what would be the best way to approach this… Sever connect side or on the client side?
If anybody can help i would appreciate it.

Following should do the trick:

<div dmx-repeat:repeat1="details.data.repeat_x_times">
  id: {{details.data.query[0].id}}-{{$index}}
</div>

You could also change the query type to Single Record, it will then return the object directly instead of an array with a single record.

1 Like

So simple… thanks Patrick… you wont believe the stuff i tried with “while” and “repeat” in SC… hahaha… but thank you so much for this…