bradjasper / ImportJSON

Import JSON into Google Sheets, this library adds various ImportJSON functions to your spreadsheet
GNU Lesser General Public License v3.0
2.11k stars 1.06k forks source link

Invalid Argument on Time-based Trigger #103

Open omniphonix opened 6 years ago

omniphonix commented 6 years ago

I have ImportJSON running once per night to pull data from Apple's App Store. It seems to work fine when I edit the sheet and it has to go pull refreshed data, but I am getting nightly emails like this:

Invalid argument: http://[object%20Object] (line 429, file "importJSON")

Whenever the time-based trigger runs (usually around 3:18am). I was trying to just ignore it, but I think data is not actually getting refreshed. Any ideas?

anaxoras commented 6 years ago

I have the same problem!

LarsEjaas commented 6 years ago

I think I found the source of the problem, but I have no Idea how to fix it.. The function url.indexOf is not supported in jQuery 3.0 - so a bit of code has to be rewritten or patched I guess?

omniphonix commented 5 years ago

I updated to 1.5.0 and still getting the same error but now it has moved to line 219...

Invalid argument: http://{year=2019,%20month=2,%20day-of-month=27,%20day-of-week=3,%20week-of-year=9,%20hour=10,%20minute=18,%20second=53,%20timezone=UTC,%20authMode=FULL,%20triggerUid=1926862140} (line 219, file "importJSON")

Vadorequest commented 5 years ago

I had a similar issue, it's because we can't specify the triggered function's arguments and the current date is sent as an object by the trigger.

omniphonix commented 5 years ago

Is there a way to not send the date or another type of scheduled trigger that won't send the date?

Vadorequest commented 5 years ago

@omniphonix I didn't find a way to do that. But I found another workaround which I explained there (it's a draft yet): https://medium.com/unly-org/how-to-consume-any-json-api-using-google-sheets-and-keep-it-up-to-date-automagically-fb6e94521abd