# Ignition Trend Config Storage

**URL:** <https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736>\
**Category:** Ignition\
**Created:** [March 2, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736 "2020-03-02T16:09:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [March 2, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736/1 "2020-03-02T16:09:04Z")

</div>

Hello All, we are currently allowing users to save trend configs such that the next time they are opened all previous settings are restored. Have a look at the code for the save trend button below.

```auto
TagName = event.source.parent.LoopData

udtPath = 'TrendFiles/' + TagName
if not system.tag.exists(udtPath):
	system.tag.addTag(parentPath='TrendFiles', name=TagName, tagType="UDT_INST",attributes={"UDTParentType":"TrendConfiguration"})

tagPath = udtPath + "/Pens"
pensStringPath = udtPath + "/PensString"
axesPath =udtPath + "/Axes"
axesStringPath = udtPath + "/AxesString"
subplotsPath = udtPath + "/SubPlots"
subplotsStringPath = udtPath + "/SubPlotsString"
durationPath = udtPath + "/TrendDuration"
unitsPath = udtPath + "/Unit"

Value = system.dataset.toCSV(event.source.parent.getComponent('Easy Chart').tagPens,1,1,0)
system.tag.write(pensStringPath,Value)

Value = system.dataset.toCSV(event.source.parent.getComponent('Easy Chart').axes,1,1,0)
system.tag.write(axesStringPath,Value)

Value = system.dataset.toCSV(event.source.parent.getComponent('Easy Chart').subplots,1,1,0)
system.tag.write(subplotsStringPath,Value)

system.tag.write(durationPath,event.source.parent.getComponent('Easy Chart').unitCount)
system.tag.write(unitsPath,event.source.parent.getComponent('Easy Chart').unit)

```

I am wondering if we can leverage some of the new JSON functions to do this more cleanly going forward with V8. Your thoughts?

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [March 3, 2020, 2:21am UTC](https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736/2 "2020-03-03T02:21:07Z")

</div>

Hello Hello Hello is there anybody out there???

---

<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:** [March 3, 2020, 12:20pm UTC](https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736/3 "2020-03-03T12:20:46Z")

</div>

There’s lots of us out here. But you seem to be blazing a new trail. That makes you the expert. (:

---

<div class="post-metadata">

**Author:** ![franklepkowski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/franklepkowski/32/4808_2.png) [@franklepkowski](https://forum.inductiveautomation.com/u/franklepkowski)\
**Post date:** [March 3, 2020, 1:14pm UTC](https://forum.inductiveautomation.com/t/ignition-trend-config-storage/32736/4 "2020-03-03T13:14:16Z")

</div>

Me the expert, I wish!!!
