Skip to content Skip to sidebar Skip to footer

Why Is This Urlfetch Function Not Working Properly?

This is the function I'm trying to run through the JavaScript Tool on my Google Spreadsheet chart, the function is currently working on 4 different websites, where in this example:

Solution 1:

It looks like that endpoint is returning an array of objects, so if you want to access the first item in the array change your try block to:

try {
  return parseFloat(html[0]["price_btc"]);
}

Solution 2:

try html.price_btc or html[0].price_btc

Solution 3:

return html[0].price_btc;

made it work, thank you all!

Post a Comment for "Why Is This Urlfetch Function Not Working Properly?"