# Templating from chart's dataset

## Overview

As an App Builder, you could want to display information from datasets to contextualize your stories.

## Usage

In order to template the dataset's column value, you'll need to use the following syntax:

```
<$= data["CHART_ID"]["datasetColumn"] $>
```

In the " Information " section, you can retrieve the chart's ID inside its configuration form, inside the "Information" section.

<figure><img src="/files/aPOOtUwRnMHtLW34gouD" alt="" width="143"><figcaption></figcaption></figure>

However, when referring to a column resulting from an aggregation made through the SmartEditor, the column ("my\_column") to which you must refer follows this format: \_\_aggregType\_myColumn\_\_.

So for example, when referring to a column "profit" aggregated with the sum operator, the syntax to use will be:

```
<$= data["4c7274d9-bae4-e77c-d1ef-21ddd98dee0c"]["__sum_profit__"] $>
```

Here is the list of the different aggregation prefixes: sum (for sum), avg (for average), min (for minimum), max (for maximum), first (for first), last (for last), count (for count), count distinct (for Count Distinct).

{% hint style="warning" %}
As of today, you can't refer to a column that isn't used in your chart's configuration.
{% endhint %}

## Example in a Narrative

**Templating**

*(also starring a Filter's value)*

<figure><img src="/files/ak9UZBlqxgvq8gERKROn" alt=""><figcaption></figcaption></figure>

**Templated**

<figure><img src="/files/jmBkmr5d3Xim3vU4gmQ1" alt="narrative-templated"><figcaption><p>Narrative - templated</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-v3.toucantoco.com/visualizations-and-layouts/creating-visualizations/advanced-chart-configuration/templating-from-charts-dataset.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
