COINGECKO icon indicating copy to clipboard operation
COINGECKO copied to clipboard

Cannot read property 'toUpperCase'

Open muchobrento opened this issue 4 years ago • 15 comments

TypeError: Cannot read property 'toUpperCase' of undefined GECKOPRICE @ CoinGecko.gs.gs:51 Screen Shot 2021-02-10 at 10 42 01 AM

muchobrento avatar Feb 10 '21 17:02 muchobrento

I'm not sure where the issue comes from. The toUpperCase() function works fine in my country. I know not all Google Sheets have the same specifications. Depending on the country, I've seen differences.

Here is a public template sheet with the embed CoinGecko.gs code. If you duplicate, it should work fine.

https://docs.google.com/spreadsheets/d/1QODede4loYFnd9ig_f4vRiO4J4uptxn8zIx3qRsLDeA/edit?usp=sharing

Eloise1988 avatar Feb 11 '21 16:02 Eloise1988

Same issue no luck. The pull gets hung up in "Error Loading Data..."

d3dawizard avatar Feb 13 '21 22:02 d3dawizard

+1 same issue here.

devinmancuso avatar Feb 21 '21 17:02 devinmancuso

I think I know what MY issue was, maybe it is similar. I just had too many pull requests from google. I left my google sheets up and went to bed. It timed everything out for 24h, gave it a break and it worked. I have since moved on, but I really liked this idea.

d3dawizard avatar Feb 21 '21 18:02 d3dawizard

Issue seems to come from the localization of Sheet.

Depending on the country, formulas are written differently.

In File Spreadsheet setting, check that Locale is set as United States photo_2021-04-15 09 19 39

If it's not you can, for example for France, you would call formula using a semi-colon instead of a comma. Let's say you want Bitcoin's price:

When locale is set to United States formula is: =GECKOPRICE("BTC","USD")

When locale is set to FRANCE formula is: =GECKOPRICE("BTC";"USD")

Eloise1988 avatar Apr 15 '21 07:04 Eloise1988

Im having the same problem. image I changed my spreadsheet time and local to United Stated but it still doesnt read the "toUpperCase" method

joaojorgem avatar Apr 19 '21 12:04 joaojorgem

Did you try the 2 formulas one with comma and the other one with semi colon: When formula is, what do you get ? =GECKOPRICE("BTC","USD")

When formula is, what do you get ? =GECKOPRICE("BTC";"USD")

FYI: you can reach me here: https://t.me/TheCryptoCurious It's easier to trouble shoot.

Eloise1988 avatar Apr 19 '21 12:04 Eloise1988

I figured it out First I fixed the local and time zone for these settings: [image: image.png] Then I used the formula : =GECKOPRICE("BTC","USD")

And

Em seg., 19 de abr. de 2021 às 13:58, Eloisa @.***> escreveu:

Did you try the 2 formulas one with comma and the other one with semi colon: When formula is, what do you get ? =GECKOPRICE("BTC","USD")

When formula is, what do you get ? =GECKOPRICE("BTC";"USD")

FYI: you can reach me here: https://t.me/TheCryptoCurious It's easier to trouble shoot.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Eloise1988/COINGECKO/issues/3#issuecomment-822445586, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOS35HIT7GSK4N636EGGVRTTJQSFVANCNFSM4XNMDXIA .

joaojorgem avatar Apr 19 '21 13:04 joaojorgem

I figured it out. First I changed the spreadsheet settings to the following one in the image attached (Even though I'm in Ireland atm); Then I used the function : " =GECKOPRICE("XXX", "USD") " on my spreadsheet column . Sometimes this function doesn't work properly so I used : " =GECKOPRICE("XXX", "USD" ,$A$1)"

When I execute the script it still doesn't work. It gives me an error message on the line 50, for the "toUpperCase" method. But the function works fine on the spreadsheet.

  • The code has to be implemented and saved and allowed on the Script editor, it doesn't need to run .
  • The local and time zone has to be changed to the United States.
  • The functions above have to be written exactly the way they are (besides de XXX of course which is the token acronym).

Em seg., 19 de abr. de 2021 às 13:58, Eloisa @.***> escreveu:

Did you try the 2 formulas one with comma and the other one with semi colon: When formula is, what do you get ? =GECKOPRICE("BTC","USD")

When formula is, what do you get ? =GECKOPRICE("BTC";"USD")

FYI: you can reach me here: https://t.me/TheCryptoCurious It's easier to trouble shoot.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

joaojorgem avatar Apr 19 '21 13:04 joaojorgem

Hello,

I'm getting the same issue as stated above.

I have the spreadsheet settings to be in the United States. I've tried copying the spreadsheet you linked above as well, I get the same error when debugging the code on that sheet too.

Has there been any fix for this?

sbdonslaught avatar Apr 24 '21 12:04 sbdonslaught

Hello,

Thank you for letting me know. I changed the settings of the sheets. It should work now when you make a copy of the following sheet:https://docs.google.com/spreadsheets/d/1QODede4loYFnd9ig_f4vRiO4J4uptxn8zIx3qRsLDeA/edit?usp=sharing

Eloise1988 avatar Apr 24 '21 17:04 Eloise1988

I don't know why but I'm still getting this issue. :/

I've duplicated the sheet, tested it on my own, ran the debug, and it's still not liking the toUpperCase and toLowerCase function.

I'm not sure what other troubleshooting I can do. Any advice?

This is what I'm getting still; Apr 24, 2021, 2:24:50 PM Error TypeError: Cannot read property 'toUpperCase' of undefined at GECKOPRICE(CoinGecko:53:17)

sbdonslaught avatar Apr 24 '21 18:04 sbdonslaught

The code doesnt need to run properly to have the function GECKOPRICE working on ur google sheet. Ignore that toUpperCase method On Sat 24 Apr 2021 at 19:28, sbdonslaught @.***> wrote:

I don't know why but I'm still getting this issue. :/

I've duplicated the sheet, tested it on my own, ran the debug, and it's still not liking the toUpperCase and toLowerCase function.

I'm not sure what other troubleshooting I can do. Any advice?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Eloise1988/COINGECKO/issues/3#issuecomment-826134602, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOS35HJ76BEQ7TKLUQ23NADTKMETRANCNFSM4XNMDXIA .

joaojorgem avatar Apr 24 '21 18:04 joaojorgem

What is the message you get when entering your formula in Google Sheets? Can you print screen your formula?

Eloise1988 avatar Apr 24 '21 19:04 Eloise1988

I don't know what changed, but I made a third copy of the spreadsheet linked above and it seems to be working now.

Thank you for the quick responses, I really appreciate the help and the scripts! :)

sbdonslaught avatar Apr 24 '21 19:04 sbdonslaught