I am creating a dialog to show and edit document properties in a sidebar of Google Spreadsheets.
I managed to show the property values in the sidebar and even create text input fields to interact with via the sidebar. But finally I'm not able to get the values back into the server-side script using a serverHandler.
How are interactive dialogs with a sidebar are supported in Google Sheets?
You don't say, but it sounds like you're using UiApp for your sidebar.
A serverHandler will receive the value of the element that the handler was attached to. For instance:
When
myServerHandler()
gets invoked due to a button press, it will receive the value ofbutton
in the event object.To pass other values to the serverHandler, use
addCallbackElement()
to attach them to the handler.Now we will also received the input of the text box
clientInput
, as an attribute namedparameter["client-input"]
.Example
This simple example of a spreadsheet-contained script gets one piece of input from the user, passes it to a serverHandler, which then updates the sidebar to display a computational result.