Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 1
    Instead of calling ImportJSON() as a custom function in a spreadsheet formula, call it directly from your time-driven function code, and store the 2D array you get as the return value in the spreadsheet using Range.setValues(). Commented Nov 2, 2021 at 13:54
  • @doubleunary I thought about that, but I don't know where is the final output code written in the ImportJSON script. It has many functions calling each other and that Range.setValues() would need to sit at the very end. Also, this might require me to add additional parameters to all the functions in the chain in order to be able to call it either from a triggered auto-update function or directly from a formula written into a cell. Commented Nov 2, 2021 at 14:13
  • @TLSO Please read github.com/bradjasper/ImportJSON/blob/master/README.md Commented Nov 2, 2021 at 15:45
  • @Rubén I don't think these explanations are related to my question. Is there a way to change a cell's value within the same sheet from a custom function? I thought about making the triggered function also give some cell on the JSON sheet a value ("update", for example) and then after the ImportJSON function is called from the cell its written onto, have the ImportJSON function first check whether that cell is != "update" and return; if it is. If it is == then it will change value to "stop" and continue the function. The problem is SpreadsheetApp doesn't work from the cell-written function. Commented Nov 2, 2021 at 16:06
  • Please edit the question to clarify what you are asking. Commented Nov 2, 2021 at 16:15