docMaker User guide
  • 👋Welcome to docMaker
  • Features
    • Create pdf from docx template
      • 🏗️Build your docx template
        • Overview
        • Text substitution
        • Images
        • Conditions
        • Loops
          • Simple list
          • List with multiple values
          • Adding rows into a table
          • Loops in columns + lines (grids)
          • Nested loops
        • QR codes
        • Rich text & html
      • ⚙️docx_fill_convert API parameters
    • Fill-out pdf forms
      • 🔧Build your pdf form
      • ⚙️pdf_fill API parameters
    • Print web page to pdf
      • ⚙️page_pdf API parameters
  • INTEGRATIONS
    • Typeform
      • Create pdf or docx for each Typeform response
    • Bubble.io
      • 📝Easy pdf from docx template
      • 📋Fill-out pdf forms
      • 🖥️Webpage to pdf
    • Make.com
    • Coda
    • Xano
    • Zapier
    • API
  • FAQ
    • 🫧Bubble.io questions
    • 📄Questions on docx templates
    • 📙Questions on pdf templates
Powered by GitBook
On this page
  1. Features
  2. Create pdf from docx template
  3. Build your docx template
  4. Loops

Simple list

PreviousLoopsNextList with multiple values

Last updated 1 year ago

The loop should have a a JSON array strcuture, i.e. : be embedded in [ ] and contain key/ value pairs inside { } , as shown below :

{
"cars" : [
    {"brand" : "Renault"},
    {"brand" : "Tesla"  },
    {"brand" : "Toyota" }
  ]
}

As the loop contains only one element, we can use a dot tag {.} to create a list.

Template

Result

{#cars}

- {.}

{/cars}

  • Renault

  • Tesla

  • Toyota

If the data loop contained more than 1 item type, then we would have to specify which data we want to display, with this tag :{brand} :

Template

Result

{#cars}

- {brand}

{/cars}

  • Renault

  • Tesla

  • Toyota

🏗️
➡️
➡️