google-drive-cms icon indicating copy to clipboard operation
google-drive-cms copied to clipboard

Object field type

Open JosefJezek opened this issue 9 years ago • 1 comments

Could you add object field type? Cell content...

key1: value1
key2: value2
colors.red: #f00
colors.green: #0f0
colors.blue: #00f

Output...

{
  "colors": {
    "red": "#f00",
    "green": "#0f0",
    "blue": "#00f"
  }
}

Arrays of objects field type

name: Amanda
age: 26
name: Tessa
age: 30

Output...

[
    {
      "name": "Amanda",
      "age": "26"
    },
    {
      "name": "Tessa",
      "age": "30"
    }
]

Check out ArchieML...

  • http://archieml.org
  • http://www.phillipadsmith.com/2015/12/the-google-cms.html

JosefJezek avatar Aug 29 '16 08:08 JosefJezek

Hey @JosefJezek

Yes you're right. Deep nested objects need thinking about. I actually have something similer on a site that I'm using the Google Drive CMS on. It's why I created the "Eval" field.

It's not pretty but if you add..

[
    {
      "name": "Amanda",
      "age": "26"
    },
    {
      "name": "Tessa",
      "age": "30"
    }
]

... to a field and then set its type to "eval" it will add it as-is to the JSON payload. You can use Sheets functions calling on other cells if you want to make it a bit neater.

Will return and address this problem properly though.

max-barry avatar Sep 27 '16 11:09 max-barry