# Turn on History on a Dataset

**URL:** <https://forum.inductiveautomation.com/t/turn-on-history-on-a-dataset/16944>\
**Category:** Ignition\
**Created:** [February 9, 2018, 7:55pm UTC](https://forum.inductiveautomation.com/t/turn-on-history-on-a-dataset/16944 "2018-02-09T19:55:20Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![R.Alamsha](https://avatars.discourse-cdn.com/v4/letter/r/e5b9ba/32.png) [@R.Alamsha](https://forum.inductiveautomation.com/u/R.Alamsha)\
**Post date:** [June 29, 2018, 7:19am UTC](https://forum.inductiveautomation.com/t/turn-on-history-on-a-dataset/16944/9 "2018-06-29T07:19:34Z")

</div>

> [@abhimanyu.chopra](#):
>
> Is there anyway history can be enabled for datasets, or is there a better method to do this?

Can't you directly subscribe individual tags to MQTT payload?.

**If Not:**

[https://docs.inductiveautomation.com/display/DOC79/Datasets](https://docs.inductiveautomation.com/display/DOC79/Datasets)

Check the above link. You have to extract each value to another history enabled tag. But you will get new timestamps (timestamp for remote timestamp too). Finally you have to trigger and run the script too whenever the payload arrives. Looking for a payload to arrive, strangely defeats the very purpose of MQTT publish/subscription protocol. For me, it looks like some sort of crude data butchering with a blunt knife 🙂 This is an unviable solution for production deployment.

**The best solution is, build your own Java MQTT driver module for Ignition.**

If you want to save the JSON payload into a text file and import it directly into the historian database along with remote timestamps, check this topic. Later, you can consume that data through query tags. I think, this can very well be done outside Ignition through some PHP scripting. Just "the other way around" solution.

> [@Automatic IOT data collection by FTP](http://forum.inductiveautomation.com/t/automatic-iot-data-collection-by-ftp/16845/4):
>
> something like this would put a csv file into a db table. [pymsql](https://pypi.python.org/pypi/PyMySQL) is pure python. # csv to MySQL import os, shutil, csv, pymysql inputPath = '/path/to/input/folder/' archivePath = '/path/to/archive/folder' # get list of files files = os.listdir(inputPath) if len(files) \> 0: # set MySQL connection connection = pymysql.connect(host='host.com', user='', password='', db='', cursorclass=pymysql.cursors.DictCursor) # set query query = 'INSERT INTO table VALUES(%s, %s, %s, %s, %s)' # …

---

_[View the full topic](https://forum.inductiveautomation.com/t/turn-on-history-on-a-dataset/16944)._
