FOR in WordRepeat paragraphs and table rows by looping through data in Word templates.Sep 25, 2025Knowledge
InformationArticle BodyExamples Use Case 1: Training schedule Loop through training session records to build a schedule table with session name, date, trainer, and location in each row. Example data: { TrainingSessions: [ { Name: "Intro", Date: "2024-01-01", Trainer: "Alice", Location: "Room A" }, { Name: "Advanced", Date: "2024-01-02", Trainer: "Bob", Location: "Room B" } ]} Template Document: Output: Use Case 2: Quote line items Create a pricing table by iterating through quote lines and inserting product, quantity, price, discount, and total. Conditionally show a dash when no discount is given. Example data: { Quote: { LineItems: [ { ProductName: "Widget", Quantity: 2, UnitPrice: 50, Discount: 0.1, TotalPrice: 90 }, { ProductName: "Gadget", Quantity: 1, UnitPrice: 100, Discount: 0, TotalPrice: 100 } ] }} Template Document: Output: Notes Table rows containing FOR or END-FOR are removed from the output. FOR and END-FOR can also be used to duplicate the following items: List itemsText on the same line (such as comma separated lists)Pages (include a page break right before your END-FOR command)Tables Next Steps About FOR FOR in Excel FOR in PowerPoint TitleFOR in WordURL NameFOR-in-Word