Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9626

Import Balance Sheets to Google Sheets using Google Script and Alpha Vantage [closed]

$
0
0

I'm quite new to Scripts and coding and I'm stuck with a Balance Sheet JSON file from Alpha Vantage that I just can't seem to get into Google Sheets in usable format.

This is the code I currently have:

  function get_Balance_Sheet(){  var ss = SpreadsheetApp.getActiveSpreadsheet();  var Input = ss.getSheetByName("Input")  var ticker = ss.getRange("A1").getValue();  var response = UrlFetchApp.fetch("https://www.alphavantage.co/query?   function=BALANCE_SHEET&symbol="+ticker+"&apikey="+API_KEY+"&outputsize=compact");  var json = response.getContentText();  var data = JSON.parse(json);  var BalanceS = ss.getSheetByName('BS data');  if(!BalanceS){    ss.insertSheet('BS data');  }  var cell = BalanceS.getRange(1,1, data.length, data[0].length);  cell.setValues(data);}

I know that I have to transpose the data somehow to have it look like an actual Balance Sheet, but I have no idea how this is supposed to work.

Hope anyone can help me and I've given enough information about my problem.


Viewing all articles
Browse latest Browse all 9626

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>