# Adding Multiple Routines at the same time (not manually adding them)

**URL:** <https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409>\
**Category:** Builder\
**Created:** [April 2, 2024, 9:29pm UTC](https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409 "2024-04-02T21:29:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alkan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alkan/32/41455_2.png) [@alkan](https://discourse.psychopy.org/u/alkan)\
**Post date:** [April 2, 2024, 9:29pm UTC](https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409/1 "2024-04-02T21:29:37Z")

</div>

Hi everyone!

For our experiment, we need to add 20 blocks of the same two routines (20 trials loop each) with another 20 blocks of another two routines between each of the first (10 trials loop each).

Therefore, manually inserting all routines is rather time consuming.

What is the intended solution for this use-case? I haven’t found a concrete answer through my searches.

Thanks!

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [April 2, 2024, 11:06pm UTC](https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409/2 "2024-04-02T23:06:09Z")

</div>

Concentric loops

Try to avoid making copies of routines. You can, if necessary, insert the same routine into the flow more than once but loops are even more efficient.

---

<div class="post-metadata">

**Author:** ![alkan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/alkan/32/41455_2.png) [@alkan](https://discourse.psychopy.org/u/alkan)\
**Post date:** [April 9, 2024, 11:25pm UTC](https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409/3 "2024-04-09T23:25:40Z")

</div>

Thank you for your reply!

Therefore the issue is to find how to iterate through different rows for each loop. I will keep looking for a post about it.

And if not I will start another topic.

(Let’s say, hypothetically ( 😅), I have 400 rows in an excel file, for each loop i want to iterate to the 20 first, the 20 next, etc… until 400. )

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [April 10, 2024, 6:43am UTC](https://discourse.psychopy.org/t/adding-multiple-routines-at-the-same-time-not-manually-adding-them/39409/4 "2024-04-10T06:43:36Z")

</div>

That sounds like one loop pointing at the spreadsheet and changes to the routines based on trials.thisN. It might also need independent randomisation from my online demos

> [@PsychoPy Online Demos](https://discourse.psychopy.org/t/psychopy-online-demos/22319):
>
> If you have routines or experiments that are likely to be useful to others, please create a post in this thread, editing your post to add new demos so there is one post per creator. Ideally set your demos so they can be tested without consuming a credit (if you don’t have a site license) by adding a final routine that can’t end, disabling save incomplete results and adding a small number of credits. Please do not discuss the demos in this thread or create more than one post unless you have a la…
