# Sparkline Dynamic Tag History Expression Binding

**URL:** <https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [March 3, 2021, 12:08am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008 "2021-03-03T00:08:54Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali.Etezadkhah](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Ali.Etezadkhah](https://forum.inductiveautomation.com/u/Ali.Etezadkhah)\
**Post date:** [March 3, 2021, 12:08am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/1 "2021-03-03T00:08:54Z")

</div>

Hi,

I would like to use a sparkline display along with my transmitter value in Perspective. My goal is to provide a tag path to the view that contains the transmitter and sparkline to make them interactive. The transmitter parameter passing works fine, but I cannot get the sparkline to work properly.

According to this video, it should be possible to create a custom array of objects, with each object containing values for path, alias, and aggregate and use it in a Tag History Binding. The video is for a table but I think it should work for a sparkline as well since they both use Tag History Binding

[https://inductiveuniversity.com/videos/tag-history-binding—expression/8.0](https://inductiveuniversity.com/videos/tag-history-binding---expression/8.0)

I followed the format in the manual.;

"Using Dynamic Tag Paths

Tag History bindings have the option to list out Tag paths, or to use an expression to build a Tag path. It is common to create a dynamic path or set of paths as a component property, that you then reference in other places. You can use as many Tag paths as you want, but they must all follow this format:

```
key [array] 

    [0] {object}
        aggregate value
        alias value
        path value
    [1]{object}
        aggregate value
        alias value
        path value

```

"

Here is my CUSTOM property for the sparkline:

 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/53ba964aa247df63ef0636625c8ca442e5a7f64b.jpeg)

When I bind the Tag History directly to a tag, it works fine, but when I try to use an expression, I get an error message:

 ![Capture2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/3/a3240b5f8ce0c84e2ab5613526b057b098fa88ef.jpeg)

What am I doing wrong here? The PV is the data source for both the transmitter and sparkline. I know the sparkline uses tag history whereas the transmitter uses direct or indirect tags, but making the sparkline dynamic should be as simple as making the transmitter dynamic.

I can make the tag binding dynamic by using a parameter. All this does is to alter the tag path by adding some text to it.

 ![num1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/0/60cf9e80c1f5df23ad3e1ac313eea5184daf3149.jpeg)

Why can’t the same option be used in a Tag History Binding? I understand a dataset is required, but if the configuration can take a direct tag path and create the dataset behind the scene, why can’t it use a parameter to alter the tag path and do the same thing as a direct path?

 ![num2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/9/497a7cbe825521c7a24217b096d5a561b95a9620.jpeg)

Thank you,  
Ali

---

<div class="post-metadata">

**Author:** ![deon.korb](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@deon.korb](https://forum.inductiveautomation.com/u/deon.korb)\
**Post date:** [March 3, 2021, 4:55am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/2 "2021-03-03T04:55:27Z")

</div>

I don’t think it accepts _default_ as an aggregate. Try something explicit, like _average_.

---

<div class="post-metadata">

**Author:** ![OscarLucas](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/oscarlucas/32/6417_2.png) [@OscarLucas](https://forum.inductiveautomation.com/u/OscarLucas)\
**Post date:** [May 7, 2021, 10:15am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/3 "2021-05-07T10:15:07Z")

</div>

Did you finally get the answer? I am trying to do the same.

---

<div class="post-metadata">

**Author:** ![Ali.Etezadkhah](https://avatars.discourse-cdn.com/v4/letter/a/b19c9b/32.png) [@Ali.Etezadkhah](https://forum.inductiveautomation.com/u/Ali.Etezadkhah)\
**Post date:** [May 20, 2021, 7:07pm UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/4 "2021-05-20T19:07:25Z")

</div>

Hi Oscar,  
I ended up using a workaround since Perspective doesn’t support indirect history tag binding.

I bound the sparkline PROPS-points to a view parameter called Sparkline.

 ![sp1](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/e/eead1e08b610ef41852f9bd7577d38409df45392.jpeg)

Then I bound the Sparkline parameter from my embedded view to a static tag history.

 ![sp2](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b8e3617bb13edf30d54f68019cf5d8e1cbcaa78c.jpeg)

As workarounds go, it’s not too bad, but I wish Perspective would support indirect tag history binding.

Good luck.

---

<div class="post-metadata">

**Author:** ![hunterdg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hunterdg/32/67774_2.png) [@hunterdg](https://forum.inductiveautomation.com/u/hunterdg)\
**Post date:** [May 31, 2021, 10:44am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/5 "2021-05-31T10:44:57Z")

</div>

@Ali.Etezadkhah,

@deon.korb was _almost_ right. `aggregate: default` doesn’t appear to be supported. `aggregate: Average` works ( **case sensitive** )

I omit the alias parameter, as I believe it’s useless with a sparkline, and I omit the aggregate parameter, assuming it defaults to “average” - and my original query mode was “AsStored”.

(someone please correct me if I’m wrong).

Still, tag history indirection would be nice.

---

<div class="post-metadata">

**Author:** ![bwhite](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bwhite/32/7112_2.png) [@bwhite](https://forum.inductiveautomation.com/u/bwhite)\
**Post date:** [August 4, 2021, 3:08pm UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/6 "2021-08-04T15:08:06Z")

</div>

I figured out how to use the indirect tag history binding and described for an timeseries chart. If you delete the key values of aggregate and alias, it works for the sparkline.

---

<div class="post-metadata">

**Author:** ![Steven\_Davis](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/steven_davis/32/63158_2.png) [@Steven\_Davis](https://forum.inductiveautomation.com/u/Steven_Davis)\
**Post date:** [June 9, 2023, 12:16am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/7 "2023-06-09T00:16:04Z")

</div>

I got this working through a combination of the example in the user manual and some expression magic.

- on the root I have a tagPath that is passed into the window.
- that param passes into the sparkline as a parameter called tagString
- i do some find replace magic and use a lower() function to get the path to the history tag
- then i use a custom param array like the user manual says for the history expression and point the "path" element to the historyString

boom, dynamic history sparklines

---

<div class="post-metadata">

**Author:** ![Jonathon\_Beckage](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@Jonathon\_Beckage](https://forum.inductiveautomation.com/u/Jonathon_Beckage)\
**Post date:** [September 20, 2023, 2:41pm UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/8 "2023-09-20T14:41:48Z")

</div>

This solution worked for me. Thank you!

---

<div class="post-metadata">

**Author:** ![Tommy\_Strand](https://avatars.discourse-cdn.com/v4/letter/t/65b543/32.png) [@Tommy\_Strand](https://forum.inductiveautomation.com/u/Tommy_Strand)\
**Post date:** [November 7, 2025, 9:21am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/9 "2025-11-07T09:21:44Z")

</div>

We got this working following the approach from [Ali.Etezadkhah](https://forum.inductiveautomation.com/u/ali.etezadkhah)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/6/d649b3250bf401d78d949336e3b0d4eb79e32b11.png)

Added a Custom property for the sparkline. path is bound to a view parameter that points to the parent tag. alias is not important, as it only names the column. I omitted the aggregate value, and have not tested using it in the custom property.

Then for the points binding an expression is used to bind the custom property.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/d/fd844f18c625456d69623940888c83d7824362cb.jpeg)

---

<div class="post-metadata">

**Author:** ![ayushvarma9081](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@ayushvarma9081](https://forum.inductiveautomation.com/u/ayushvarma9081)\
**Post date:** [November 13, 2025, 7:16am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/10 "2025-11-13T07:16:17Z")

</div>

> [@Tommy\_Strand](#):
>
> Then for the points binding an expression is used to bind the custom property.

how is the custom property created is it a array or a object i am unable to name the array element as “0”

---

<div class="post-metadata">

**Author:** ![Tommy\_Strand](https://avatars.discourse-cdn.com/v4/letter/t/65b543/32.png) [@Tommy\_Strand](https://forum.inductiveautomation.com/u/Tommy_Strand)\
**Post date:** [November 13, 2025, 8:15am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/11 "2025-11-13T08:15:22Z")

</div>

Hi, I created an Array, then added an array element of object, and created two object members of type value. Hope that made sense?

---

<div class="post-metadata">

**Author:** ![ayushvarma9081](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@ayushvarma9081](https://forum.inductiveautomation.com/u/ayushvarma9081)\
**Post date:** [November 13, 2025, 9:17am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/12 "2025-11-13T09:17:47Z")

</div>

thanks!

got it

---

<div class="post-metadata">

**Author:** ![ITOTKP](https://avatars.discourse-cdn.com/v4/letter/i/f04885/32.png) [@ITOTKP](https://forum.inductiveautomation.com/u/ITOTKP)\
**Post date:** [May 13, 2026, 10:21am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/13 "2026-05-13T10:21:33Z")

</div>

Dear all,

Regarding to topic about creating custom syntax. I'm not able to change "0" name to path, alias etc.

Do you have any idea ?

 ![custom](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/6/b6a9a2082b406d3c8deff1a12bfaa63eaf4cb93f.png)

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [May 13, 2026, 11:25am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/14 "2026-05-13T11:25:51Z")

</div>

> [@ITOTKP](#):
>
> I'm not able to change "0" name to path

I'm not sure which "0" name that you are referencing, but the issue is that you have created those properties as array type properties in which the items are always listed by a zero based index. If you instead want to use key value pairs, then you need to use object type properties.

---

<div class="post-metadata">

**Author:** ![ITOTKP](https://avatars.discourse-cdn.com/v4/letter/i/f04885/32.png) [@ITOTKP](https://forum.inductiveautomation.com/u/ITOTKP)\
**Post date:** [May 13, 2026, 11:44am UTC](https://forum.inductiveautomation.com/t/sparkline-dynamic-tag-history-expression-binding/44008/15 "2026-05-13T11:44:32Z")

</div>

Thank you !
