---
title: "How to add dynamic content to a custom popup"
description: "Choose between equations, charts, conditionals, and interactive buttons in a custom popup, with links to the setup guide for each one."
seo:
  title: "Add dynamic content to popups"
sidebar:
  label: "Add dynamic content"
---

A custom popup can also calculate values, draw charts, hide sections when conditions fail, and link to feature-specific URLs. Each has a toolbar button in the popup editor; this page helps you choose one, with links to the per-extension setup guides.

## Before you start

- The popup type must be `Custom`. See [How to write a custom popup template](/docs/configuring-popups/write-custom-popup-template).
- You should be comfortable inserting `{field_name}` variables. Most dynamic content depends on attribute values. See [How to insert attribute values into a custom popup](/docs/configuring-popups/insert-attribute-values-into-popup).

## The four extensions

To pick one, start from what the viewer needs to see or do:

<!-- diagram:popup-dynamic-content-flow -->
<svg class="dark:hidden" style="width: 100%; height: auto" viewBox="0 0 640 708" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="popup-dynamic-content-flow-inline-title popup-dynamic-content-flow-inline-desc">
  <title id="popup-dynamic-content-flow-inline-title">Which dynamic content to add</title>
  <desc id="popup-dynamic-content-flow-inline-desc">Flowchart: use a conditional to show content or words only for some values, an equation for a number worked out from fields, a chart to compare a few number fields, an interactive button to open a page or start an email, call or text, and plain attribute values for everything else.</desc>
  <defs>
    <marker id="popup-dynamic-content-flow-inline-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0, 8 3, 0 6" fill="#525252"/></marker>
    <marker id="popup-dynamic-content-flow-inline-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0, 8 3, 0 6" fill="#c4360c"/></marker>
  </defs>
  <rect width="100%" height="100%" fill="#f5f5f5"/>
  <path d="M192 60 L192 86" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M316 136 L358 136" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M316 272 L358 272" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M316 408 L358 408" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M316 544 L358 544" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M192 184 L192 222" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M192 320 L192 358" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M192 456 L192 494" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <path d="M192 592 L192 630" fill="none" stroke="#525252" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-arrow)"/>
  <rect x="318" y="112" width="34" height="16" rx="2" fill="#f5f5f5"/><text x="335" y="124" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="248" width="34" height="16" rx="2" fill="#f5f5f5"/><text x="335" y="260" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="384" width="34" height="16" rx="2" fill="#f5f5f5"/><text x="335" y="396" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="520" width="34" height="16" rx="2" fill="#f5f5f5"/><text x="335" y="532" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="200" y="195" width="26" height="16" rx="2" fill="#f5f5f5"/><text x="213" y="207" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="331" width="26" height="16" rx="2" fill="#f5f5f5"/><text x="213" y="343" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="467" width="26" height="16" rx="2" fill="#f5f5f5"/><text x="213" y="479" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="603" width="26" height="16" rx="2" fill="#f5f5f5"/><text x="213" y="615" fill="#525252" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="76" y="16" width="232" height="44" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/>
  <text x="192" y="43" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">What should viewers get?</text>
  <polygon points="192,88 316,136 192,184 68,136" fill="rgba(196,54,12,0.08)" stroke="#c4360c" stroke-width="1.4"/><text x="192" y="131" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Content or words only</text><text x="192" y="149" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">for some values?</text>
  <polygon points="192,224 316,272 192,320 68,272" fill="#ffffff" stroke="#171717" stroke-width="1"/><text x="192" y="267" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A number worked</text><text x="192" y="285" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">out from fields?</text>
  <polygon points="192,360 316,408 192,456 68,408" fill="#ffffff" stroke="#171717" stroke-width="1"/><text x="192" y="403" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A few number fields</text><text x="192" y="421" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">to compare?</text>
  <polygon points="192,496 316,544 192,592 68,544" fill="#ffffff" stroke="#171717" stroke-width="1"/><text x="192" y="539" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A page to open, or</text><text x="192" y="557" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">someone to contact?</text>
  <rect x="360" y="100" width="264" height="72" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/><text x="492" y="122" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Conditional</text><text x="492" y="142" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">show or hide a section, or a word</text><text x="492" y="158" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">such as Open or Closed, by value</text>
  <rect x="360" y="236" width="264" height="72" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/><text x="492" y="258" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Equation</text><text x="492" y="278" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">the result is always a number;</text><text x="492" y="294" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">for words, use a conditional</text>
  <rect x="360" y="372" width="264" height="72" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/><text x="492" y="394" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Chart</text><text x="492" y="414" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">a bar or pie chart of</text><text x="492" y="430" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">the feature’s number fields</text>
  <rect x="360" y="508" width="264" height="72" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/><text x="492" y="530" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Interactive button</text><text x="492" y="550" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">a web link, or an email,</text><text x="492" y="566" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">phone call or text message</text>
  <rect x="62" y="632" width="260" height="60" rx="20" fill="rgba(23,23,23,0.04)" stroke="rgba(23,23,23,0.32)" stroke-width="1"/>
  <text x="192" y="657" fill="#171717" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Attribute values</text>
  <text x="192" y="675" fill="#525252" font-size="12" font-family="inherit" text-anchor="middle">insert the values as text</text>
</svg>
<svg class="hidden dark:block" style="width: 100%; height: auto" viewBox="0 0 640 708" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="popup-dynamic-content-flow-inline-dark-title popup-dynamic-content-flow-inline-dark-desc">
  <title id="popup-dynamic-content-flow-inline-dark-title">Which dynamic content to add</title>
  <desc id="popup-dynamic-content-flow-inline-dark-desc">Flowchart: use a conditional to show content or words only for some values, an equation for a number worked out from fields, a chart to compare a few number fields, an interactive button to open a page or start an email, call or text, and plain attribute values for everything else.</desc>
  <defs>
    <marker id="popup-dynamic-content-flow-inline-dark-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0, 8 3, 0 6" fill="#a3a3a3"/></marker>
    <marker id="popup-dynamic-content-flow-inline-dark-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0, 8 3, 0 6" fill="#ff7a4d"/></marker>
  </defs>
  <rect width="100%" height="100%" fill="#141414"/>
  <path d="M192 60 L192 86" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M316 136 L358 136" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M316 272 L358 272" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M316 408 L358 408" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M316 544 L358 544" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M192 184 L192 222" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M192 320 L192 358" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M192 456 L192 494" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <path d="M192 592 L192 630" fill="none" stroke="#a3a3a3" stroke-width="1.2" marker-end="url(#popup-dynamic-content-flow-inline-dark-arrow)"/>
  <rect x="318" y="112" width="34" height="16" rx="2" fill="#141414"/><text x="335" y="124" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="248" width="34" height="16" rx="2" fill="#141414"/><text x="335" y="260" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="384" width="34" height="16" rx="2" fill="#141414"/><text x="335" y="396" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="318" y="520" width="34" height="16" rx="2" fill="#141414"/><text x="335" y="532" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">YES</text>
  <rect x="200" y="195" width="26" height="16" rx="2" fill="#141414"/><text x="213" y="207" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="331" width="26" height="16" rx="2" fill="#141414"/><text x="213" y="343" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="467" width="26" height="16" rx="2" fill="#141414"/><text x="213" y="479" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="200" y="603" width="26" height="16" rx="2" fill="#141414"/><text x="213" y="615" fill="#a3a3a3" font-size="10" font-weight="600" letter-spacing="0.1em" font-family="inherit" text-anchor="middle">NO</text>
  <rect x="76" y="16" width="232" height="44" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/>
  <text x="192" y="43" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">What should viewers get?</text>
  <polygon points="192,88 316,136 192,184 68,136" fill="rgba(255,122,77,0.10)" stroke="#ff7a4d" stroke-width="1.4"/><text x="192" y="131" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Content or words only</text><text x="192" y="149" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">for some values?</text>
  <polygon points="192,224 316,272 192,320 68,272" fill="#1c1c1c" stroke="#f2f2f2" stroke-width="1"/><text x="192" y="267" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A number worked</text><text x="192" y="285" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">out from fields?</text>
  <polygon points="192,360 316,408 192,456 68,408" fill="#1c1c1c" stroke="#f2f2f2" stroke-width="1"/><text x="192" y="403" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A few number fields</text><text x="192" y="421" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">to compare?</text>
  <polygon points="192,496 316,544 192,592 68,544" fill="#1c1c1c" stroke="#f2f2f2" stroke-width="1"/><text x="192" y="539" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">A page to open, or</text><text x="192" y="557" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">someone to contact?</text>
  <rect x="360" y="100" width="264" height="72" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/><text x="492" y="122" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Conditional</text><text x="492" y="142" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">show or hide a section, or a word</text><text x="492" y="158" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">such as Open or Closed, by value</text>
  <rect x="360" y="236" width="264" height="72" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/><text x="492" y="258" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Equation</text><text x="492" y="278" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">the result is always a number;</text><text x="492" y="294" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">for words, use a conditional</text>
  <rect x="360" y="372" width="264" height="72" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/><text x="492" y="394" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Chart</text><text x="492" y="414" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">a bar or pie chart of</text><text x="492" y="430" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">the feature’s number fields</text>
  <rect x="360" y="508" width="264" height="72" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/><text x="492" y="530" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Interactive button</text><text x="492" y="550" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">a web link, or an email,</text><text x="492" y="566" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">phone call or text message</text>
  <rect x="62" y="632" width="260" height="60" rx="20" fill="rgba(242,242,242,0.05)" stroke="rgba(242,242,242,0.34)" stroke-width="1"/>
  <text x="192" y="657" fill="#f2f2f2" font-size="14" font-weight="600" font-family="inherit" text-anchor="middle">Attribute values</text>
  <text x="192" y="675" fill="#a3a3a3" font-size="12" font-family="inherit" text-anchor="middle">insert the values as text</text>
</svg>
<!-- /diagram:popup-dynamic-content-flow -->

Each extension has its own toolbar button in the Custom popup editor, except interactive buttons, which you add with `Set link`. They render when the popup opens and use the feature attributes.

### Equations

|  |  |
| --- | --- |
| What it does | Displays a computed numeric value inline |
| Use when | You want a value that's derived from one or more attributes — a ratio, a difference, a sum |
| Example | `Density:`, then an equation of `{population} / {area}`, then `people/km²` |

Click `Insert equation` and type a small expression in the equation editor. The expression supports attribute references (`{population}`, `{area}`), arithmetic operators (including modulo and exponentiation), and functions such as `round`, `floor`, `min`, and `max`. The expression evaluates per feature, so layer-wide aggregations (`sum`, `avg`, `count`) aren't available here — those live in the Query and Proximity Analysis tools. The result is always a number. To show a word for a value, such as `Open` or `Closed`, use a conditional.

For full setup, see [How to add a calculated value to a custom popup](/docs/configuring-popups/add-equations-to-popup). For the syntax, see [Calculator formula syntax](/docs/configuring-popups/calculator-formula-reference); for worked examples, see [How to use operators and functions in equations](/docs/configuring-popups/use-operators-and-functions-in-equations).

### Charts

|  |  |
| --- | --- |
| What it does | Renders a chart inside the popup, driven by feature attributes |
| Use when | A feature carries a small set of comparable values — quarterly figures, category breakdowns, before/after pairs |
| Example | A bar chart of `q1, q2, q3, q4` revenue per feature |

The chart extension opens a configuration modal where you pick the chart type and the attributes that supply the data.

For full setup, see [How to add a chart to a custom popup](/docs/configuring-popups/add-charts-to-popup).

### Conditionals

|  |  |
| --- | --- |
| What it does | Shows or hides a section based on a feature's attribute values |
| Use when | Some features should display different content, or some sections shouldn't render when an attribute is empty |
| Example | "Show the 'Booking link' section only if `bookable` is true" |

The conditional extension opens a 3-step wizard: define the condition, configure the content for the true and false branches, and review with a sample evaluation.

For full setup, see [How to show or hide content based on a feature's attributes](/docs/configuring-popups/add-conditional-content-to-popup).

### Interactive buttons

|  |  |
| --- | --- |
| What it does | Renders a clickable button that opens a web page, or starts an email, a phone call, or a text message |
| Use when | You want viewers to take an action — open a deeper page, view in another system, copy a reference |
| Example | "View on Wikipedia" button that opens the right page for each feature using `{wikipedia_slug}` |

The interactive button extension lets you choose a `Link type` (`Web link`, `Email`, `Phone`, or `SMS`), set the text and target, and choose whether a web link opens in a new tab. You can style the item as a button with `Size`, `Colour`, and `Variant` controls, or clear `Display as button` to insert a plain text link instead. Targets accept `{field_name}` variables for per-feature links.

For full setup, see [How to add an interactive button to a custom popup](/docs/configuring-popups/add-interactive-buttons-to-popup).

## How they compose

You can combine these extensions, such as placing a chart inside a conditional or an equation in a button label. A common pattern:

- A conditional that hides the whole "Statistics" section when there's no data.
- Inside the section, a chart of category breakdowns plus a couple of equations comparing the feature to the layer average.
- Below, an interactive button linking to a deeper data source.

When a popup has several dynamic elements, test each one with a real feature before combining them. The Custom popup editor doesn't show a live preview with sample data, so the map is where you test it.

## Save and verify

After inserting any dynamic content, click `Save Changes` at the bottom right of the editor. Then open the map and click a feature on the layer to verify the content renders as expected.

If something doesn't render correctly, check:

- Variables resolve correctly — see the troubleshooting in [How to insert attribute values into a custom popup](/docs/configuring-popups/insert-attribute-values-into-popup).
- Equation syntax is valid — see [Calculator formula syntax](/docs/configuring-popups/calculator-formula-reference).
- Conditional logic matches the data — open the conditional builder's `Test` step (Step 3) for a sample evaluation.

## Related

- [How to add a calculated value to a custom popup](/docs/configuring-popups/add-equations-to-popup)
- [How to add a chart to a custom popup](/docs/configuring-popups/add-charts-to-popup)
- [How to show or hide content based on a feature's attributes](/docs/configuring-popups/add-conditional-content-to-popup)
- [How to add an interactive button to a custom popup](/docs/configuring-popups/add-interactive-buttons-to-popup)
- [How to write a custom popup template](/docs/configuring-popups/write-custom-popup-template)
- [Popup tab controls](/docs/configuring-popups/popup-reference)
