V
V
Vladimir Zuev2020-07-18 12:19:02
Google Apps Script
Vladimir Zuev, 2020-07-18 12:19:02

How to call a function in google sheets sidebar?

Hello.
To debug the code, you need to call a function from index.html and the picker.html frame.
Tried to call the createModel() function through this code from the script file

function runCreateModel(){
createModel()
};

Unsuccessfully.
I tried to call a function from the picker.html frame in this way.
function runCreateModel(){
//createModel()
document.getElementById("iframe").contentWindow.createModel();
};

Again unsuccessful. Please help. How to correctly call a function in a script file from index.html and picker.html frame?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Zuev, 2020-07-19
@vladd56

And how to call the function on loading. Can be an example.

M
mityayka1, 2020-07-19
@mityayka1

You can call GAS functions from within template html scripts using google.script.run
It is not possible to call a function from GAS. Unless on the document.onload event

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question