Dynamic Tables & Logic

Make your templates smart. Learn how to generate lists that grow automatically and hide sections that aren't needed.

1. Dynamic Line Items

If your Google Form uses a "Multiple Choice Grid," "Checkbox Grid," or if you are merging data where one cell contains multiple values (e.g., "Product A, Product B, Product C").

How to set up the Table

You do not need to create 10 rows in your template. You only need one row.

  1. Insert a Table in Google Docs with a Header Row and 1 Data Row.
  2. Place your markers in the Data Row: {{Item}} | {{Qty}} | {{Cost}}.
  3. When the add-on runs, if it detects multiple values for these markers, it will automatically duplicate the row for each item found.

2. How Data Splitting Works

Smart Form Publisher needs to know how to split a single cell of text into multiple table rows.

Default Separator

Google Forms typically stores multiple answers (Checkboxes) separated by a comma and a space (, ). The add-on detects this and creates a new row for every comma found.

Mismatched Lists

If you have two columns (Item and Price), ensure both have the same number of items. If "Items" has 3 entries but "Price" only has 1, the table usually repeats the single price 3 times.


3. Row Numbers & Totals

Professional invoices often need row numbers and a grand total.

  • Row Indexing: In Google Docs, you can use the built-in "Numbered List" feature inside the first cell of your repeating row. As the rows expand, Google Docs automatically increments the numbers (1, 2, 3...).
  • Calculating Totals: Smart Form Publisher replaces text; it doesn't usually perform math inside the Doc.
    Best Practice: Calculate the "Grand Total" in your Google Sheet using a formula (=SUM(...)), then map that final total cell to a marker like {{Grand Total}} in the footer of your template table.

4. Conditional Hiding (Hide-if-Empty)

What happens if a user skips an optional question? You don't want a blank line in your address label.

Google Docs Behavior

In most cases, if a marker {{Address Line 2}} is empty, the add-on removes the text. However, the line break might remain.

Tip: Group related items on the same line if possible, separated by commas (e.g., {{City}}, {{State}}), so the layout doesn't break if one is missing.

Google Slides Behavior

Slides are more rigid. If a marker is empty, the text box remains but is empty.

Tip: Use separate text boxes for optional fields so they don't leave large gaps in the middle of a paragraph.


Troubleshooting Tables

  • Table not expanding? Ensure all markers are in the same row. If you put {{Item}} in row 1 and {{Price}} in row 2, the add-on won't treat it as a single repeatable record.
  • Formatting lost? If the first row is Bold, all generated rows will be Bold. Ensure your template row has the exact styling you want for the final list.