function makeGetRequest() {
const url = "www";
const response = UrlFetchApp.fetch(url, {
"method": "GET",
"headers": {
"accept": "application/json",
"X-API-Key": "abc",
},
});
Logger.log("Response code is %s", response.getResponseCode());
Logger.log(response.getContentText());
}
I refer to the api in google scirpt. I get the result like this:
{"value":{"value":"a","x":b,"name":"jhon","age":"20"},"b":1," Address":"street","city":"munchen"}
However, I can not go through the values, I have error data is not funcion
var results = data.hits;
results.forEach(function (result) {
Logger.log(result.title);
I want to extract only 2 data from json (name + adress) but I don't know how to do it