Possible to use a loop within schema settings for a “collection of items” to not repeat myself?

Topic summary

A developer is building a Shopify theme block via an app that requires users to upload images, videos, or text up to 6 times (18 total fields). They want to avoid hardcoding all 18 fields in the schema settings.

Current approach:

  • Using standard schema settings with repeated field definitions
  • Each “block” contains 3 fields: image_picker, video, and text

Attempted solution:

  • Tried using Liquid {% for %} loops within the {% schema %} block to dynamically generate field definitions
  • Unclear if this approach is valid in Shopify’s schema JSON structure

Status:

  • Question remains unanswered regarding loop feasibility
  • One responder offered to review custom code but requested private collaboration details
  • No definitive solution or confirmation provided yet about whether dynamic loops are supported in schema settings
Summarized with AI on October 23. AI used: claude-sonnet-4-5-20250929.

Hello. I am building a theme block via an app that requires a user to upload either an image, video, or text. They can do this up to 6 times so in all 18 fields. Is there a way to be able to include a dynamic loop in my scheme settings so I do not have to hardcode 18 fields?

My code:

{% schema %}
{
  "name": "Test Block",
  "target": "section",
  
  "settings": [
    {
      "type": "header",
      "content": "Test Block",
      "info": "Use the fields below to add text or a video"
    },
    {
      "type": "text", 
      "id": "title", 
      "label": "Block Title", 
      "default": "Heading"
    },
    {
      "type": "textarea",
      "id": "description",
      "label": "Description",
      "default": "Description"
    },
    {
      "type": "header",
      "content": "Block 1",
    },
---- Section I would like to loop ---
    { 
      "type": "image_picker",
      "id": "Test_image",
      "label": "Image"
    },
    {
      "type": "video",
      "id": "Test_video",
      "label": "Video"
    },
    {
      "type": "text",
      "id": "Test_quote",
      "label": "Quote"
    }
-----------
  ],
}
{% endschema %}

So something like this?

{% for i in (1..5) %}
  {% if i == 4 %}
    {% break %}
  {% else %}
        {
      "type": "image_picker",
      "id": "Test_image",
      "label": "Image"
    },
    {
      "type": "video",
      "id": "Test_video",
      "label": "Video"
    },
    {
      "type": "text",
      "id": "Test_quote",
      "label": "Quote"
    }
  {% endif %}
{% endfor %}

Hey,

The requested changes requires to do the custom code in your theme file.

Could you please share your store url along with the collab code in the p/m so that i can take a look into it.
Thanks