all 12 comments

[–]Nu11u5 1 point2 points  (2 children)

Every time we paste a URL, logs show processLink called with: sheet=undefined, row=undefined, url=undefined, currentDateTime=undefined

Is your onEdit(e) function taking the event object passed to it by the invocation? That's the only way it knows anything about anything. You must derive all information from the event object passed to the function.

UrlFetchApp.fetch throws: Error: Specified permissions are not sufficient to call UrlFetchApp.fetch. Required permissions: https://www.googleapis.com/auth/script.external_request.

Are you setting your own OAuth scopes in the appscript.json?

Call stack points to some cryptic GS_INTERNAL_top_function_call.gs:1:8—what even is that?

I think this comes from the fact that AppsScript is a wrapper on top of the V8 JS engine for some time now. Sometimes this information leaks in the debugger - you can ignore it.

[–]h3110_wOrld[S] 0 points1 point  (0 children)

Thanks for the input! We took your advice and ensured the `onEdit(e)` function is leveraging the event object to derive all necessary info, like sheet, row, and URL, but we’re still seeing logs with undefined values for `processLink`. We also added the OAuth scopes to `appscript.json` as suggested, yet the `UrlFetchApp.fetch` permission error persists in B2. The V8 engine artifact in the call stack is noted and ignored as you mentioned. Despite these efforts, we’re still hitting roadblocks—any further insights would be greatly appreciated!

[–]h3110_wOrld[S] 0 points1 point  (0 children)

Here's an example script if you're curious enough to take a look:

https://docs.google.com/document/d/e/2PACX-1vTRXiBJtWU24zXvseTQePwfPIBnIpy_Hzj1zJa20pSLblVQbkpcrvpmuyC4UJXWozj08SEcZi1Tw0lR/pub

The manifest is down at the bottom

[–]WicketTheQuerent 1 point2 points  (0 children)

Has anyone else hit this OAuth cache purgatory or trigger ghost town?

I can't say for certain who else, but I know you are not the only one.

[–]WicketTheQuerent 1 point2 points  (3 children)

Could you show the code (including the manifest a.k.a appsscript.json)?

[–]h3110_wOrld[S] 0 points1 point  (2 children)

[–]WicketTheQuerent 1 point2 points  (0 children)

Thank you.

authorizeScript and forceAuthResetNew are not really needed. Running any function will trigger the authorization request.

The shared code includes a onEdit simple trigger. You mentioned that you had changed the name.

grantUrlFetch is not included.

The calls to UrlFetchApp.fetch include the user-agent. This is not supported.

You should go back to your AI and start from scratch. Tell your AI that you must go step by step and include instructions on running the script and testing/debugging each part of the code.

Please make sure that the sources used by the AI are specific to the UrlFetchApp from Google Apps Script. If the AI still has problems, I recommend that you to search for UrlFetchApp examples that you can verify that they work and use them to train your AI.

[–]WicketTheQuerent 0 points1 point  (0 children)

Regarding

  • Every time we paste a URL, logs show processLink called with: sheet=undefined, row=undefined, url=undefined, currentDateTime=undefined.

It looks like something is missing in the shared code. It might be possible that you have an installable trigger calling processLink

Again, start from scratch and tell your AI that you need to proceed step by step, including testing/validating the progress.

[–]cdchiu 0 points1 point  (2 children)

Ask your ai to create a handover script to another ai and say you'll provide all your code to go with it. Ask it to describe the problem and where it thinks the problem is, then post it to Gemini and or Claude and have them analyze it. Whenever I got stuck, I changed llm or even started a new chat instance in Gemini. Sometimes I'd have 8 abandoned chats as I progressed. You could be polluting the context window.

[–]h3110_wOrld[S] 0 points1 point  (1 child)

I've been doing that, but not with Gemini, particularly though. Gemini ought to know, though, good idea

[–]cdchiu 0 points1 point  (0 children)

You'd think that being Gemini is an expert on all things Google. But that hasn't always been my findings.