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

Question: Export Cell Objects #58

Closed oneezy closed 6 years ago

oneezy commented 6 years ago

I'm having trouble exporting cell objects from the documenation instructions... Can you please explain how to do it properly?

oneezy commented 6 years ago

If anyone else is wondering how to do this:

  1. Make sure you have Export cell objects checked in the sidebar
  2. Write your object in the cell like this { "Key1": "Value 1", "Key2": "Value 2", "Key3": "value 3" }

JSON Output (Google Sheet Example)

{
  "data-1": {
    "ID1": {
      "ID": "ID1",
      "CLASS": "class-1",
      "EXPORT CELL OBJECT": {
        "Key1": "Value 1",
        "Key2": "Value 2",
        "Key3": "value 3"
      }
    },
    "ID2": {
      "ID": "ID2",
      "CLASS": "class-2",
      "EXPORT CELL OBJECT": {
        "Key1": "Value 1",
        "Key2": "Value 2",
        "Key3": "value 3"
      }
    },
    "ID3": {
      "ID": "ID3",
      "CLASS": "class-3",
      "EXPORT CELL OBJECT": {
        "Key1": "Value 1",
        "Key2": "Value 2",
        "Key3": "value 3"
      }
    }
  }
}
Synthoid commented 6 years ago

Sorry for the delayed response. I’m currently traveling so it’s difficult to do my usual GitHub management.

In order to export cell objects. You must write valid JSON directly into a cell. This means open and close braces ( { and } ) as well as properly formatted field names wrapped with quotes and colons separating keys from values.

if the JSON entered is not valid, an empty JSON object ( {} )will be added to your export instead.