Synthoid / ExportSheetData

Add-on for Google Sheets that allows sheets to be exported as JSON or XML.
MIT License
236 stars 46 forks source link

Export as Dictionary #103

Closed imtrobin closed 4 years ago

imtrobin commented 4 years ago

Hi, I like to request a feature to export as a dictionary

e.g ID X Y Z test1 1 1 1 test2 2 2 2

to become

{
  "Sheet1": {
    "test1": {"X": 1,      "Y": 1,      "Z": 1    },
    "test2": {X": 2,      "Y": 2,      "Z": 2    }
    }
  }

Current the ID is repeated in the element, like this

{
  "Sheet1": {
    "test1": {      "ID": "test1",      "X": 1,      "Y": 1,      "Z": 1    },
    "test2": {      "ID": "test2",      "X": 2,      "Y": 2,      "Z": 2    }
 }
Synthoid commented 4 years ago

XML has something like this already. Probably I'll just move that option to the General section so both XML and JSON can support that feature. Does that seem like what you are wanting?

imtrobin commented 4 years ago

yes, quite similar. I use this tool , the option "Output as JSON dictionary"

https://thdoan.github.io/mr-data-converter/

Synthoid commented 4 years ago

This is now the default behavior when exporting JSON. As I postulated above, the Include first column option now affects both JSON and XML, so this behavior can be toggled on or off based on your needs!