I am not skilled at programming. What I am trying to do is for personal use only and will just make my life easier. I am trying to make a script for Google Sheets that will fetch Facebook insights and display them in the Google doc. I have made this work for simpler values like integers and strings, but in this case, I want to return a list and am not sure how to fetch it or return it.Here is the open source script that I have modified: \[code\]////// Facebook Fans Counter// Made by Martin Hassman, http://twitter.com/hassmanm// Released as Public Domain// Look at http://labs.met.cz/ for other tools// Edit by Jared Beach//function FacebookImpressionsByCity(aPageId,aToken){ if (aPageId === undefined || aPageId === null) { throw "No parameter specified. Write Facebook PageID as parameter." } if (aToken === undefined || aToken === null) { throw "No parameter specified. Write Facebook Access Token as parameter." } var today = new Date(); today.setDate(today.getDate()-5); var dd = today.getDate(); var mm = today.getMonth()+1; //January is 0! var yyyy = today.getFullYear(); if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} today = yyyy+'-'+mm+'-'+dd; if (typeof aPageId != "number") throw "Parameter must be number."; // See http://developers.facebook.com/docs/reference/fql/page/ for API documentation var url = "https://api.facebook.com/method/fql.query?query=SELECT%20metric,%20value%20FROM%20insights%20WHERE%20object_id=%22"+ encodeURIComponent(aPageId) + "%22%20AND%20metric=%27page_impressions_by_city_unique%27%20AND%20end_time=end_time_date%28%27"+ encodeURIComponent(today) +"%27%29%20AND%20period=period%28%27day%27%29%20&%20access_token=" + encodeURIComponent(aToken); var response = UrlFetchApp.fetch(url); if (response.getResponseCode() != 200) throw "Unexpected response code from Facebook."; var responseText = response.getContentText(); if (responseText == null || responseText == "") throw "Empty response from Facebook."; var value = http://stackoverflow.com/questions/14564041/new Array(); try { var xml = Xml.parse(responseText, false); var page = xml.getElement().getElement(); if (page == null) throw"Wrong PageID."; value = http://stackoverflow.com/questions/14564041/(page.getElement("value").getText()); } catch (e) { throw "Problem with response from Facebook: " + e; } return page;}\[/code\]Here is the XML page I want to get a list from:\[code\]<fql_query_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" list="true"> <SCRIPT/> <insights> <metric>page_impressions_by_city_unique</metric> <value list="true"> <insMap key="Mexico City, Distrito Federal, Mexico">3</insMap> <insMap key="Tuscaloosa, AL">3</insMap> <insMap key="Belgrade, Serbia">2</insMap> <insMap key="Guntersville, AL">1</insMap> <insMap key="Helena, AL">1</insMap> <insMap key="Prague, Hlavni Mesto Praha, Czech Republic">1</insMap> <insMap key="Saint Petersburg, Saint Petersburg City, Russia">1</insMap> <insMap key="Kuala Lumpur, Wilayah Persekutuan, Malaysia">1</insMap> <insMap key="Coker, AL">1</insMap> <insMap key="Milton, FL">1</insMap> <insMap key="Birmingham, AL">1</insMap> <insMap key="Raleigh, NC">1</insMap> <insMap key="Cottondale, AL">1</insMap> <insMap key="Morris, AL">1</insMap> <insMap key="Akron, AL">1</insMap> <insMap key="Slobozia, Ialomita, Romania">1</insMap> <insMap key="Guadalajara, Jalisco, Mexico">1</insMap> <insMap key="Kawaguchi, Chiba, Japan">1</insMap> <insMap key="Taipei, Taiwan">1</insMap> <insMap key="Coronel Dorrego, Buenos Aires, Argentina">1</insMap> <insMap key="Tokyo, Japan">1</insMap> <insMap key="Kobe, Hyogo, Japan">1</insMap> <insMap key="Algiers, Alger, Algeria">1</insMap> <insMap key="Islamabad, Pakistan">1</insMap> <insMap key="Strazow, Rzeszow, Poland">1</insMap> </value> </insights></fql_query_response>\[/code\]What is the best way, not only to get and store these values, but also to return them in a way that is easy to understand to the reader. Keep in mind, this program is only for me. Any sloppiness does not matter. My job is social media marketing specifically for Facebook pages and I want to be able to fetch my own insights for my clients.