Dynamic Variables

Written By Minh

Last updated 1 day ago

Dynamic Variables let you create unique content for each page by pulling values from your dataset. Instead of writing the same text for every page, you write it once with variables, and SEOmatic fills in the right value for each row.

Quick Example

Your dataset:

City

Service

New York

Plumbing

Chicago

Roofing

Miami

Landscaping

Your field template:

Best {{ Service }} in {{ City }}

Generated output:

  • Page 1: "Best Plumbing in New York"

  • Page 2: "Best Roofing in Chicago"

  • Page 3: "Best Landscaping in Miami"

One template, three unique pages.

Syntax

A variable is a column name wrapped in double curly braces:

{{ ColumnName }}

The column name must match a column in your dataset. It is not case-sensitive - {{ city }}, {{ City }}, and {{ CITY }} all work.

How to Use Variables

Type {{ in any text field and an autocomplete dropdown shows your available columns. Select one and it appears as a purple badge. You can also type the full variable manually.

Variables work in text fields, URLs, email fields, image URLs, and JSON fields. They do not work in dropdowns, toggles, color pickers, or file upload fields. They also work inside Spin Syntax and AI Generation prompts - for example:

genText("Write a tagline for {{ City }}").

Lists, Links, and Images

Variables work the same way regardless of the content type. Here's how to use them for common use cases.

Lists

To add a dynamic list, put your list items in a dataset column - one item per line. Then insert the variable in a Rich text field. The line breaks from your dataset are preserved in the published content.

Example dataset:

City

Services

New York

  • Plumbing

  • Electrical

  • HVAC

Chicago

  • Roofing

  • Siding

  • Gutters

Miami

  • Landscaping

  • Pool Cleaning

  • Pest Control

In your Rich Text field, insert {{ Services }} and each page will display the list from its row.

Links

To add a dynamic link, create a dataset column with your URLs. You can use the variable in a Link field, or insert it as a hyperlink in a Rich Text field.

Example dataset:

Use {{ Website }} in a Link field or link it to text in the Rich Text editor. Make sure your URLs are complete (including https://) to avoid broken links.

Images

To add a dynamic image, create a dataset column with image URLs. Use the variable in an Image URL field, or insert it into a Rich Text field using the image dialog.

Example dataset:

Use {{ Image }} in an Image URL field. Supported formats are JPG, PNG, GIF, and WebP. Make sure the URLs are publicly accessible - private or expired links will result in broken images.

Tips

  • Keep column names simple. "City" and "Service" are easier to work with than "Column_A_Data_v2".

  • Check the preview. It shows exactly what your variables will resolve to before you generate.

  • Combine with AI for personalized content. genText("Write 3 benefits of {{ Service }} in {{ City }}") creates unique content for every page.

Troubleshooting

Problem

Solution

Variable shows as plain text instead of a purple badge

The column name doesn't match any column in your dataset. Check for typos or extra spaces. Column names must match exactly (though casing doesn't matter).

Variable appears as {{ ColumnName }} in the generated output

ame issue - the variable didn't match a dataset column. Open your dataset and verify the column exists with that name.

Variable is replaced with nothing (blank)

The column exists but the value is empty for that row. Open your dataset and check that the row has a value in that column.

Autocomplete dropdown doesn't appear when typing {{

Make sure your project has a dataset with at least one column. The autocomplete only shows up when there are columns available to reference.

Variable works in preview but not in generated content

Make sure you saved your field values before generating. If you edited the dataset after previewing, regenerate to pick up the latest data.