0
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

letbet
  • 1
  • If the linked duplicate answers doesn't answer your question, [edit] your question to explain how the answers don't satisfy your question. If you're having trouble implementing a solution in the duplicate or don't understand a solution provided, ask a new specific question with the part you're having trouble with. – TheMaster Jan 05 '22 at 11:59

0 Answers0