# How do I automate tag properties? History and storage provider

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650>\
**Category:** Ignition\
**Created:** [December 5, 2025, 3:15pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650 "2025-12-05T15:15:21Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![drawlings](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@drawlings](https://forum.inductiveautomation.com/u/drawlings)\
**Post date:** [December 5, 2025, 3:15pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/1 "2025-12-05T15:15:21Z")

</div>

I have a few hundred sparkplug devices being added via the MQTT Engine. How do I automate the tag property to have history enabled with my storage provider?

Or is this not a thing? These are all devices sending timeseries data and there will be thousands of tags that need this enabled.

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [December 5, 2025, 4:11pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/2 "2025-12-05T16:11:05Z")

</div>

You could possibly script something using [`system.tag.configure`](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-configure).

pturmel's [Spredsheet Import Tool](https://forum.inductiveautomation.com/t/spreadsheet-import-tool/93500) might also be of use.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 5, 2025, 4:17pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/3 "2025-12-05T16:17:05Z")

</div>

Be aware the MQTT tag providers can arbitrarily **remove** your tags, too, and any follow-up configuration you do may be lost. Consider using another tag provider that has **reference tags** pointing into the MQTT provider, and enable history on the reference tag. The source tag can then come and go without breaking your history.

---

<div class="post-metadata">

**Author:** ![drawlings](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@drawlings](https://forum.inductiveautomation.com/u/drawlings)\
**Post date:** [December 5, 2025, 11:16pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/4 "2025-12-05T23:16:24Z")

</div>

Thank you. I managed to create reference tag script that runs periodically. Is this the best way to handle this type of data. The devices always send in approx a days worth of data at one time. So far I haven’t been able to get any backfill data to populate in my Postgres database.

---

<div class="post-metadata">

**Author:** ![ShaneH](https://avatars.discourse-cdn.com/v4/letter/s/3e96dc/32.png) [@ShaneH](https://forum.inductiveautomation.com/u/ShaneH)\
**Post date:** [December 8, 2025, 10:52pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/5 "2025-12-08T22:52:11Z")

</div>

Is it still true that back fill events on MQTT tags will not trigger the historization on reference tags?

---

<div class="post-metadata">

**Author:** ![drawlings](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@drawlings](https://forum.inductiveautomation.com/u/drawlings)\
**Post date:** [December 10, 2025, 8:19pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/6 "2025-12-10T20:19:49Z")

</div>

I was able to get MQTT engine tags created with history and my chosen provider using this:

```python
const definitions = {};
tagDefs.forEach(def => {
    definitions[def.tagName] = {
        dataType: 'Double',
        properties: {
            engUnits: { type: 'String', value: def.unit },
            documentation: { type: 'String', value: def.documentation },
            historyEnabled: {type: 'Boolean', value: true,},
            historyProvider: {type: 'String', value: 'Postgres',}
        }
    };
});

```

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 10, 2025, 8:24pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/7 "2025-12-10T20:24:14Z")

</div>

You really should not use `def` as a variable name, as it is a python reserved word.

---

<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:** [December 10, 2025, 8:39pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/8 "2025-12-10T20:39:48Z")

</div>

That's apparently a Javascript snippet, so no idea where they're executing that code... NodeRED, maybe?

---

<div class="post-metadata">

**Author:** ![drawlings](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@drawlings](https://forum.inductiveautomation.com/u/drawlings)\
**Post date:** [December 10, 2025, 8:43pm UTC](https://forum.inductiveautomation.com/t/how-do-i-automate-tag-properties-history-and-storage-provider/112650/9 "2025-12-10T20:43:57Z")

</div>

Yes, Node-RED.
