2
我使用的是Google AdWords /應用腳本,並且我收到了DoubleClick Search的回覆。我試圖解析它以將Sheet /放入數組中以使用,而且我沒有太多運氣。謝謝你看看。如何解析Google App腳本中的JSON響應?
這是原來的代碼:
var response = authUrlFetch.fetch(url, options);
var data = JSON.stringify(response.getContentText());
var parsedData = JSON.parse(data);
{
"kind": "doubleclicksearch#report",
"request": {
"reportType": "advertiser",
"columns": [
{
"columnName": "agency"
},
{
"columnName": "agencyId"
},
{
"columnName": "advertiser"
},
{
"columnName": "advertiserId"
}
],
"includeRemovedEntities": false,
"statisticsCurrency": "usd",
"startRow": 0,
"rowCount": 10000
},
"statisticsCurrencyCode": "USD",
"rowCount": 2,
"rows": [
{
"agency": "a",
"agencyId": "11111111111111",
"advertiser": "aa",
"advertiserId": "11111111111111"
},
{
"agency": "b",
"agencyId": "222222222222222",
"advertiser": "bb",
"advertiserId": "22222222222"
}
]
}
當我谷歌'如何解析JSON響應在谷歌應用程序腳本?'我似乎得到很多結果。他們都沒有幫助嗎? –
我環顧四周,但我無法找到如何與JSON設置如何做到這一點。我目前卡住了,但仍在尋找。以爲我會問。 – Josh