# Convert DataSet Tag to Json

**URL:** <https://forum.inductiveautomation.com/t/convert-dataset-tag-to-json/43115>\
**Category:** Ignition\
**Tags:** perspective, scripting, ignition80\
**Created:** [February 7, 2021, 8:21pm UTC](https://forum.inductiveautomation.com/t/convert-dataset-tag-to-json/43115 "2021-02-07T20:21:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tamerplc](https://avatars.discourse-cdn.com/v4/letter/t/d78d45/32.png) [@tamerplc](https://forum.inductiveautomation.com/u/tamerplc)\
**Post date:** [February 7, 2021, 8:21pm UTC](https://forum.inductiveautomation.com/t/convert-dataset-tag-to-json/43115/1 "2021-02-07T20:21:27Z")

</div>

I have quey tag showing return [6Rows\* 2Coulms] . I used `system.util.jsonEncode` function to convert the Dataset to JSON format, below my outcome.

```auto
{
   "columns":[
      {
         "name":"Consumption",
         "type":"java.lang.Double"
      },
      {
         "name":"LineName",
         "type":"java.lang.String"
      }
   ],
   "rows":[
      [
         26683.0,
         "CANLine 1"
      ],
      [
         23510.0,
         "CANLine 2"
      ],
      [
         58977.2998046875,
         "CANLine 3"
      ],
      [
         567.0,
         "RBGlass Line"
      ],
      [
         16586.0,
         "PETLine 1"
      ],
      [
         21981.0,
         "PETLine 2"
      ]
   ]
}

```

How can i remove the first two sets of values to be as below to use in X-Y Chart?

```auto
{
   "rows":[
      [
         26683.0,
         "CANLine 1"
      ],
      [
         23510.0,
         "CANLine 2"
      ],
      [
         58977.2998046875,
         "CANLine 3"
      ],
      [
         567.0,
         "RBGlass Line"
      ],
      [
         16586.0,
         "PETLine 1"
      ],
      [
         21981.0,
         "PETLine 2"
      ]
   ]
}

```

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [February 8, 2021, 4:26am UTC](https://forum.inductiveautomation.com/t/convert-dataset-tag-to-json/43115/2 "2021-02-08T04:26:44Z")

</div>

Hi  
Bind that tag to the data section of your xy chart and then add python script transform and loop through your json and convert it to dataset.  
Just remove the columns keyword in your dictionary

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [February 8, 2021, 9:17am UTC](https://forum.inductiveautomation.com/t/convert-dataset-tag-to-json/43115/3 "2021-02-08T09:17:53Z")

</div>

As Nader said, just remove the key from the dictionary, eg  
`obj.pop('columns', None)`

pop removes the key whether it exists or not and returns the value of the key, or the fallback (in this case None) of it didn’t exist. You don’t need to do anything with the return
