# Dataset to simplified Json

**URL:** <https://forum.inductiveautomation.com/t/dataset-to-simplified-json/64156>\
**Category:** Ignition\
**Tags:** ignition81, ignition80\
**Created:** [September 16, 2022, 10:57am UTC](https://forum.inductiveautomation.com/t/dataset-to-simplified-json/64156 "2022-09-16T10:57:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephanie\_VanDelinde](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Stephanie\_VanDelinde](https://forum.inductiveautomation.com/u/Stephanie_VanDelinde)\
**Post date:** [September 16, 2022, 10:57am UTC](https://forum.inductiveautomation.com/t/dataset-to-simplified-json/64156/1 "2022-09-16T10:57:37Z")

</div>

We need to have a dataset converted to simplified JSON and the JSON must be written to a tag in the tag database. Also need to update the unicode to quotations. I was trying to save to a document tag.  
the code I have so far.

```auto
tagpath = ("[default]path/memorytag")
data1 = system.tag.readBlocking(["[default]path/table"])[0].value
		# convert the incoming value data
	
	pyDataset = system.dataset.toPyDataSet(data1)
	columns = system.dataset.getColumnHeaders(pyDataset)
		
	data = []
	
	
	for row in pyDataset:
		rowMap = {}
		for col in columns:
			rowMap[col] = row[col]
		data.append(rowMap)	
	
	system.tag.writeBlocking(tagpath,[data])

```

Thank you in advance for your help.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [September 16, 2022, 11:58am UTC](https://forum.inductiveautomation.com/t/dataset-to-simplified-json/64156/2 "2022-09-16T11:58:27Z")

</div>

```auto
	convertedArry = []
	for row in range(dataset.getRowCount()):
		convertedRow={}
		for col in dataset.getColumnNames():
			convertedRow[col] = dataset.getValueAt(row, col)
		convertedArry.append(convertedRow)
	toJsonString=system.util.jsonEncode(convertedArry)
	

```

---

<div class="post-metadata">

**Author:** ![Stephanie\_VanDelinde](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Stephanie\_VanDelinde](https://forum.inductiveautomation.com/u/Stephanie_VanDelinde)\
**Post date:** [September 16, 2022, 9:41pm UTC](https://forum.inductiveautomation.com/t/dataset-to-simplified-json/64156/4 "2022-09-16T21:41:50Z")

</div>

Thank you solution worked perfectly!
