Custom functions intermittently hang with "Error - Loading Data"
Asked Answered
N

1

13

I have a Google Apps Script custom function, very simple:

function sharesBurned(sharesToSell) {     
  return "tree"
}

Obviously, this works when I test it in Apps Script. In my sheet, when I call it in a cell, sharesBurned(2), for instance, it sometimes returns "Loading", and in the upper right hand corner of the cell, a red triangular sign appears that, when hovered over, reads: "Error - Loading data...".

I know there have been several threads on this, but they are pretty old, and I've tried all the suggestions already to no avail, namely:

  • Changing the function name
  • Refreshing the spreadsheet
  • Toggling Parameter Cell
  • Duplicating the spreadsheet
  • Clearing Browser cache / cookies

To be clear, the function loads in the cell seamlessly half the time and the other half is stuck like this. I highly doubt it's an issue with the script itself so this is likely some weird bug (caching? no clue) with Google Sheets.

Neuropath answered 3/3, 2022 at 15:54 Comment(3)
why do u pass a parameter in your function, but you're not calling it inside?Commove
There is already an active report about Google sheets custom functions stuck in loading. You may want to click the star icon on the top left of the issue report to indicate that you are also being affected by the issue.Karole
@DavidSalomon The function is meaningless; I had a more complex function at first but changed to a super simple one to see if the issue persisted (and to confirm it wasn't an issue with my function.Neuropath
K
14

This seems to be a issue on Google's server. There is already an active report about Google sheets custom functions stuck in loading. You may want to click the star icon on the top left of the issue report to indicate that you are also being affected by the issue.

Other related issues:

Karole answered 3/3, 2022 at 19:21 Comment(6)
Credit me, if I've answered or added important data. I don't think credit is necessary for "a suggestion to add a answer"Cardiovascular
Besides following the listed issues it might be worthy to visit Google Apps Script Outage log (no recent entries yet)Handy
Great to know that I'm not alone on this one. Hope Google address this issue soon. Our workflow is quite severely affected by this. Hope more people star this issue!Smokedry
This bug fix has just been rolled out. In my case, the problem is gone now.Altarpiece
@Altarpiece The fix is for built-in functions (i.e. IMPORTXML, IMPORTHTML, ...) Do you have the Loading problem with custom functions or with built-in functions?Handy
@Rubén I am using custom functions, and the problem went away around the same time the fix was rolling out.Altarpiece

© 2022 - 2025 — McMap. All rights reserved.