# Indirect Tag History Binding Expression

**URL:** <https://forum.inductiveautomation.com/t/indirect-tag-history-binding-expression/86836>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [March 5, 2024, 3:48pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-history-binding-expression/86836 "2024-03-05T15:48:50Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 5, 2024, 4:24pm UTC](https://forum.inductiveautomation.com/t/indirect-tag-history-binding-expression/86836/3 "2024-03-05T16:24:03Z")

</div>

I think there's two fundamental things that you're missing, one of which is (in my opinion) really, really bad UX on our part.

1. The 'Expression' mode for a tag history binding expects you to author an expression **that returns a well formatted tag history configuration object**. Since you currently _cannot_ \[1\] create arbitrary array and object literals in expressions, your tag history binding expression **must** point to some other custom property literal. There's literally no other way to use expression mode.

2. You **must** specify an aggregation function when working with our historian. The historian _always_ uses some kind of compression when storing literal values \[2\]. The aggregation mode used in your tag history binding is _either_ the 'Query Mode' you specify in the dropdown at the top, _or_ the aggregation function defined per tag. If you don't want to specify an aggregation mode, just omit the key in the object you're returning via the expression. Fair play - I didn't know that it was possible to do that until I dug into the code just now.

* * *

1. without custom modules, see @pturmel's Integration Toolkit module 

2. 

> **[How the Tag Historian System Works | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/tag-historian/how-the-tag-historian-system-works#deciding-when-to-store)**
>
> This page provides an overview on how the Tag Historian system evaluates tag changes, stores them, and later retrieves those values.

---

_[View the full topic](https://forum.inductiveautomation.com/t/indirect-tag-history-binding-expression/86836)._
