> For the complete documentation index, see [llms.txt](https://help.metaforms.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.metaforms.ai/survey-programming-decipher/complexity-support/loops.md).

# Loops

Metaforms supports a wide range of Loops in your surveys.

Let's take a look at all of them:

* **Normal loop which shows some questions for brand list and the brand name is piped in those questions without any condition.**

  \
  ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXds0LGyInN8mIUiMsowlKDugwccwvrrHEp6KCKYgPeZkkfwzWguWP22g9RvO3cyBA8iFbB2X5bu0kFF9psBbJZXktLOWuJvX1bwibawhddbQ7YLDpBZjYN_riouMyXvva7GITi02qjyx3-W3UX-Rqc?key=p9-ZK2nRrJsXmd78v-iRAA)\
  \
  ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXcfjrNAM1qrB3etdCq9EpdOgSIRI25eNJxsSGNadHnXSzOzQbahxfnuTMbgDVx03-ric3oZsDJ1S2uZwdaotbSAxtIuqtriXTKsPpayKME2ZMS0laWm_gengBLR_VnEiIKuvQ4_nqv_AmidO0AaRX0?key=p9-ZK2nRrJsXmd78v-iRAA)<br>
* **Loop which shows some questions for the brand list and the brand name is piped in those questions and the loop is run only for the options selected in a previous multi select question.**\
  \
  **Base checkbox question.**\
  \
  !\[A white background with black text

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdCbhIC3gyQEK9IDE\\_WvyvU\\_7wkzD4tTOQHRezruXK9qBkjFgqhYEWyhj1aSUFCmmvL-A-hSXBtDEO5qrnv-s7BzZbEkIs-6USAXsvsiIP6j1Bf6A-ZFO2\\_SA3ZAKBevICLEq3ViR1PtlLxu6ASZQ?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  **Loop with two questions which are iterated for the option selected in the base checkbox question.**\
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeg0zLCQIoVV1olZlO7JIwORM2GMfm15nfmnnHaG35EIL2Rek9Yx3j7a6vxkkKSHFUgifKDaNiRkIwtGrKh8XiqlAp78o-JIqwUXMJ1A7pfhqzQGNMEc9jHAU7mN7M2YCSrxg-Do-Pn75i8bLByVg?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A white background with black text

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXf1O8y\\_SjF\\_dItgc7r6tRGgBWIiPGGWX7Za4JtVhBagDfCwhRs6mhTitizuovOdBkNHZUruNt5MrGoGSgH\\_e4mWcYGYEX-9EILrmCoq\\_ll54glKm7ZgYthC-7sINDk8JBXDvmgHxOw4Lks120JdCQ?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Loop with randomised iterations where one of the iterations is anchored.**\
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdccKSRc66WwkL\\_VeqVse7mlfn7UXWr1nQz4Nvhar3xTHeXJM2PbDub57gCc38Djamh4bn5Y8obTwzxXo23WvS84wm424piD-KkyVYVbKInPspAW9nKgE5d1Y5makpJfIGhLczOBqL53OAqDTuJudQ?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Loop with iterations randomised based on the question outside of the loop.**
  * Base question from which the order of the loop will be controlled based on how the options are randomised in this question\
    \
    !\[A white background with black dots

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXck16zfvDfrGATgOvX0kzTOjmgfmIbNcmD1gCFwgwet\\_-h\\_Zir3DUpjL-ng\\_64vtWh7mk9teXqc76MqNvw-\\_j8I7gvqXzcdA8LjXwXCyvrjYJG6XwsrDqSFsI3xPnCfkO1csi2ZGTX7HZF5LrvL4e8?key=p9-ZK2nRrJsXmd78v-iRAA>)
  * Loop for which the randomisation order is maintained from the base question\
    \
    !\[A white background with black dots

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfDpVWCxIImtifWt97tOUzRWGZShZ0\\_q5QWzJ5P25SYFuwT1iDdeAyrUxqeWM3zaPdYVbhVa70ENSfC7p7s7qvlR6uhqzUKrq9I3xg42omPqEfcsC0bFg84RLJ7dC-8hNjzm\\_K8KexeOteeYxiZaJM?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Loop with multiple loop variable to pipe the text.**
  * **Example** - Knowledge and Tagline Fit (Publisher + Tagline Pairs)<br>

    !\[A green square on a white background

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeMQzmEQujXqnio5mRckIdPby21A-T3\\_5qqXs9GMgR0XpzotKjPXcZKjNMrEQkG0\\_FcELzof5OXjusbvXiOKRcvrwu3JN6s8cLil66ZImmMMmOWiFBGGHAfwC2Xf1kVQQ7UeLKspGbMMZi2tHeR14Q?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
    \
    !\[A screen shot of a computer

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfQyXrFVGur5RNEkAlwiSWWNj2x39sGBIraKQMSO9LKk63Sf3IG6Aq5\\_Sr0pJJgfiPdZweDLLJ9\\_rmFPLF4d99mKmJRYpfqh97-K0tBXTbk\\_hcEDZ0ynuH50d9QA10Fgr5OIaRRAfcVxpu0TStcd\\_U?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Loop with condition some loop iterations only.**
  * Before loop there are few radio questions as below.\
    \
    !\[A white background with black dots

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfckR7TO9Khx2IX5\\_NvZtBAH6NOPnIUnn\\_Q6rACHay6ThU34G84MpwInVdxDVbovynVBoNQbb1z8cdruJOV3RXhgpzm97vJonlfqqgcX7keR6I9MSxWDIhLIrJ6rsXAJ9hcHSP4lu0qwZsYuppUg6w?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
    \
    !\[A white background with black dots

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfQAwpXfVFUuNlP9YmcpgVxT0K0LLm2pzQ\\_RhlGV6mM7vamowr7Y\\_UBjl31QVeioFav3IJq8F9UDOMtK65A6MA3q8U9tsEKDEhBI13iLcIYlgtnLmoHoULWMga48R9q6jgzI4Ne7Roe398HrRtV5po?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
  * Some iterations of the loop with condition based on previous question.

    \
    !\[A screenshot of a computer

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXf09G6PY1uuCSOXMeniIkz-uy01Y0J-1g309K5sq-fySFJIrILdRq9MF\\_hpVG0hEzHdniJpqVCPenX9pqp1fpTk7LHeFycxvJF3Mba7XhKKW\\_GaTHnjOso8Sn0Kwyhlc-Z1JBd4LwjONlpcfTYXC0c?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Question inside Loop with conditions on the options based on the loop iteration implementing this logic using looprows attribute in rows.**\
  \
  **Example**: Timings are displayed based on the type of the book\
  \
  !\[A green box with black text

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXd2RxR-G0-sIjP5DXcTqH3bF934wNA8jUG9tb0JhYk5gJc4MXxQshSE7Y6GqKJ4isVClglS\\_WWBqwieowkx04nN0QoopP2DC-VR8CgQhV7jQ3PsIuC6rTCGNklhu\\_75Rq2T8X4Kh4\\_px4-NCWCVVA?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A white background with black dots

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXca98gjWz4oUnAhuE7-f3dJBB9MYLrbL2ieX2v4x8nm8Y30N0OAZ8LitA-OWAimAfFfcje-2HFGkxcDiXvL08xiTXfRhhu9LXW5Opd3M2h5T8FvHLxszPEFVzi7Hpsrag81i0F\\_7e4\\_BwE6qWIzxQ?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A white background with black text

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXeK5TY6pZwKoPovtPzvf3DKYf8Zv-Azc9d4Z56CMbSskTrXXwfh7fteRImSoIFf7EakAcQub0bwZ5qKAheSCwfavH8QEx3rxS7BzhPyUW2T2fpJKJveU1tmh0VZnygToCqgE9Rjvj4RBcgB0AhRYA?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdrsCYK9b1IUKFgOHfG-aobi2P8IzRAekMpvelywXMnbWkFwfwyBz4X4iGxyN1QkXkSPzPVt-7IgJEDd5EXB7ARbljkz7wmIcFM4FJv4kgSasb8l6uz59Xs07XF0CwDMcz0cyU5iiNLuM8xCnqZLw?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Loop iteration shown based on the least fill logic of previous checkbox question.**

  \
  !\[A white background with black dots

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXfYctO7Xdn\\_Qq7bhCmW6206\\_jNXz5vZISAttgkRLmOnDs-1JS67kBNLv0vezpGQM9q\\_oFsvusZfXIiI7beNh5Ieg-ggQ5abvjOrL-svzckb1whN-n4IrsuPP8F1Is6H29AHWPJ7bhC\\_t4Wb8Odjvjs?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A screenshot of a computer screen

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcn8XwEEFpZjAtM9xeq-UTqHRNduzBlgezeZnAyDD9w9pBrcLtQQenoIuyBwuyo\\_RMbjeIlmCMxZ6k-Z2cuF2i45jdgWWTvuGTldqjtJ-kjWpqTvu24GO8VVxHzXCpsZROS4BYCWEBMqDi5eSCEXCY?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  Along with the main loop, below are the nested loop where options are shown based on the which iteration is currently running in the outer loop and inner loop.\
  \
  !\[A screen shot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcGbN4anc9wq1QrNHryyZTxGUKfkFBr7X1rup9eiuJm3CF-XFKBJi7wO4M8tqwBwypeYBSJm7dUZ-3IrwRX4Ez0eppsALFraHZVpVxbyRg2YOY81Jw6gwlrlHNIq4gYbKpS2yZY410yvIh4sD7PZJQ?key=p9-ZK2nRrJsXmd78v-iRAA)\\>
  \
  !\[A screenshot of a computer

  AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdJMM1GvMuCll8dLBEkzNfm3YkOl3iMI7hXLBWYlgrtGawc0I9-GTQPaO7HaLytirsIBwMpguKXDZh6u4B8zLHvUILcOo1mYpxshCNmf2t8HV2gMiTDSGveo-0JuIm0AwnRz4PlMAXi9e1EtqpJGA?key=p9-ZK2nRrJsXmd78v-iRAA>)<br>
* **Nested loop with the below logic implemented**
  * Multi-select checkbox question with different types of vehicles.\
    \
    ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXfQPY-CitX4DdzTdCFO6dV0SBWeRHBA6I0hP_pR5_Gl1qNhnTz1WD-wtCpIcpd13ewFyfKVmo8RfP2bZSbc-EHyUVYzjxvj_ptfn3IE-NbMyoTWdfgE7ioqEyKR_Q9S2_WvuS3ga69NIaRAnDAooSg?key=u6tiYUB_6T6H89odRgBJEA)<br>
  * Based on previous multi-select checkbox question, we have main loop which is asked based on the selected vehicles type.\
    \
    !\[A screenshot of a white page

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXdI6jblb\\_K13iNs2A0wPbCWZRM3KkZea7-fbpkoveCn0PaoeovRAsZSSt3xrdaGzI9ewoAyPK5R\\_vRH2yPjd14r6Iok27Y4n6i6FLTKXOmY7D4aspUkzoCjxeWFmhRBS2\\_FJAdbKnUvphS-Bx6sKA?key=u6tiYUB\\_6T6H89odRgBJEA>)<br>
  * Inside the main loop, there is a numeric question where the vehicle type appears in the question text, and different vehicle models are shown as options based on the vehicle types selected in the previous checkbox question.\
    \
    ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf2VDyBUlH4gvOBDw4YkU6WZ1SDP_om4AzLGh89_upf2a4cNio3ztgDIxPCKHKrNY_q4vJzTLS-RoDBFgqSQPBspziQBB5n687Y1Ve9pXjS6YYtSIK_akN6qjZX640L4jRokwyFK3ie7_-y66t71RI?key=u6tiYUB_6T6H89odRgBJEA)<br>
  * Inside the main loop there is inner loop based on the vehicle models, which is shown if vehicle model has value more then zero at the previous number question.\
    \
    ![](https://lh7-rt.googleusercontent.com/docsz/AD_4nXf4p1U3hHf_Fa0xB0OmKdZotN9_s5L7mTjWqewrPcIDWE5AwmVj51tbFStLajxCLDHmbT8_Hm6xEkFiP8LlEwl3qtiIabz9BbEYBTOx3Zb9S-_ZpjLOYke4r7IRp29EwZJ7zgy-HqA-XWDEBVS2pHQ?key=u6tiYUB_6T6H89odRgBJEA)<br>
  * For inner loop there are number and radio question, where value from previous number question and vehicle model text are shown in the question text.

    \
    !\[A white background with black text

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXcvcl9ltxXhTBLHIWIqJ6B0Pj6qTDPulWNPxNb2glHbPVuYW1N4x\\_DUylkQ7ZQYmi11SevmRzDFW-40fq9WAF3HbkRf3vHIGWMT1xA9XjIqpmqSxttkeu3HNk20Iw5UmvrQvKpQl6nujr72ZLFYew?key=u6tiYUB\\_6T6H89odRgBJEA)\\>
    \
    !\[A white background with black dots

    AI-generated content may be incorrect.]\(<https://lh7-rt.googleusercontent.com/docsz/AD\\_4nXftPNCkj8Xp2EtmvwRSJzZV6Ez6aARO8w9GcG8zWqAnKoFXImPDlGLn5t1V29PprAS4RIq647aEwxJx1wZRn1IiP7tyBZQxSTj6f82v\\_ZuqIjcvCsuvDPKgSP0Dg7TzuvpN0MhJYV2fixxeFqfK960?key=u6tiYUB\\_6T6H89odRgBJEA>)

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.metaforms.ai/survey-programming-decipher/complexity-support/loops.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
