Skip to content
Advertisement

reference does not exist with custom function – google script

I’m trying to call this API response using a custom function where I can change the parameters. This is my code:

JavaScript

This is what I’m typing in the spreadsheet:

JavaScript

But when I do it I get a “reference does not exist” error.

Thank you.

Advertisement

Answer

Please modify as follows and test it again.

Modified script:

JavaScript
  • Please use pair, start and end as the variables.
  • I thought that the reason of your error message is due to this. And also, please modify as follows.

Modified formula:

JavaScript
  • Please use "tBTCUSD" as a string enclosed by ".

Note:

  • For example, when pair is used as "pair", pair is the string value. By this, even when =callCandles("tBTCUSD","1577841154000","1606785154000") is used, "tBTCUSD" is not used and "pair" is used.
  • When =callCandles(tBTCUSD,"1577841154000","1606785154000") is used, in this case, tBTCUSD is used as the named range. By this, when there is no named range of tBTCUSD, #NAME? is returned. By this, pair of function callCandles(pair, start, end) { is #NAME?. Please be careful this.
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement