Paste json into google spreadsheet

I have json data in this format

{
        "jobstatus": [
            {
                "dateAndTime": "Nov 19, 2013 12:20:00 UTC",
                "jobId": "TCC_tfc",
                "userId": "admin",
                "status": "Completed",
                "jobType": "Excel Upload"
            }
        ]
    }

I am trying to create a google spreadsheet in google docs with this data. There may be several lines. So how to insert my json into the generated spreadsheet? Maybe I should use google docs api?

+1
source share
1 answer

, , JSON comand

var jobs = JSON.parse(x);

x - JSON.
, , JSON, :

jobs.jobstatus.dateAndTime -> gives you "Nov 19, 2013 12:20:00 UTC"

.

, google ( ), API Google, google :

var data = new google.visualization.DataTable(),

, JSON, :

    data.addRows(["datetime",jobs.jobstatus.dateAndTime],
      ['jobId', jobs.jobstatus.jobId],
      ['userId', jobs.jobstatus.userId],
      ['status', jobs.jobstatus.status],
      ['jobType', jobs.jobstatus.jobType]
  ]););

.

+2

All Articles