title: How do I Save JSON API response in different javascript arrays
body: <p>Working on API response that gets user data from 10K ft system via API. The response looks like:</p>
  
  <pre class="lang-js prettyprint-override"><code>"data": [{
      "id": 30000,
      "display_name": "John Doe",
      "email": "Johndoes@testmail.com",
    },
  </code></pre>
  
  <p>I want to save this data in three different arrays for each response to be used later for looping through user id. I am not sure how to go about it. Below is the code I have worked on so far. I will appreciate any help here. Thanks </p>
  
  <pre class="lang-js prettyprint-override"><code>    function getUsers() {
        var auth = 'authentication'
        var url = 'https://api.10000ft.com/api/v1/users?' + '&amp;auth=' + auth;
        var options = {
          method: 'get',
          headers: {
            Authorization: 'Bearer ' + auth
          }
        };
  
              };
             let response = UrlFetchApp.fetch(url, options);
             let json = JSON.parse(response);
                 };
      var response = UrlFetchApp.fetch(url, options);
      var json = JSON.parse(response);
      var ids = [];
      var display_names = [];
      var emails = [];
  
      function result(data) {
  
      data.forEach(element =&gt; {
                   ids.push(element.id);
      display_names.push(element.display_name);
      emails.push(element.email);
    });
  
    return { "ids": ids, "display-names": display_names, "emails": emails };
  }
  
  console.log(result(data));
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/NWExv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NWExv.png" alt="enter image description here"></a></p>