Search code examples
google-apps-scriptgoogle-sheetscustom-function

Google sheet cannot see my app script


I've created my own google app script with one function. However, when I type "=" in sheet cell I can't see this function in suggestions. Also I don't see "Loading..." label which indicates external functions loading. Moreover, I cannot reach this function by name directly. What do I miss in using google app script function with google sheets? Is it bug or should I make some additional configurations?

Thanks for your help.


Solution

  • It sounds like your script was not linked with the Sheet.

    From the Google App Scripts doc,

    A script is bound to a Google Sheets, Docs, or Forms file if it was created from that document rather than as a standalone script.

    This means if you do not use Tools -> Script editor... in the Sheet for creating the script, it will not link to the Sheet.

    From what I understand, a Standalone Script is treated as its own entity on Google Drive. This allows you to import the script if you were making a web application, for example, with the Drive REST API.

    If you don't create a standalone script, then you will create the script in a project. I don't see an option to move scripts in the Script Projects Doc at the bottom under Managing files in a project.

    Therefore, if you didn't make the script in the Sheets project, you will need to copy the contents into the project. There might also be an option for setting the project associated with the Sheet.