Dynamic Key Results HTML Code

An overview of the code needed to build out dynamic key results

Neli Ivanova avatar
Written by Neli Ivanova
Updated over a week ago

In order to create a Dynamic Key Result from an insightboard

An insight needs to be built out with specific HTML tags.

Here is an simple example of an insight ready to create a dynamic key result and the HTML code behind it

<div>
    <h1>Total Sales</h1>
    <br>
    <metric field-name="total_sales" name="Total Sales" class="bigger-2x tr">{{data.total_sales}}</metric>
</div>


Without that <metric></metric>  tag, you would not be able to create a dynamic key result using the number from an insightboard.

Within the <metric>  tag you'll need two attributes:

  1. field-name="" is the name of the output field. It should be the same as the field name returned by SQL. 

  2. name="" is the default name that will appear in the Key Result form when creating a new key result tied to the insight

Repeat for all data points needed to create a dynamic result. 

Pro Tip: 

Use the HTML snippets for pre loaded HTML code


Did this answer your question?