Message Boards Message Boards

Using EmbedCode with Google Docs

Posted 10 years ago

This post is related to an earlier post on this topic, but it is written (and meant to be read) as a standalone post.

Starting with Mathematica 10.0.1 (and also available in the Wolfram Programming Cloud) you can use "GoogleDocs" as an EmbedCode environment. For example you can do the following:

EmbedCode[ APIFunction[ {"x"->"Number"}, #x^2& ], "GoogleDocs"]

enter image description here

Now open Google Docs (http://docs.google.com) and open a new spreadsheet (select "Sheets" from the top left menu):

enter image description here

Next, click the circled (+) in the bottom right of the window to start a new spread sheet:

enter image description here

Now open the 'Script editor...' by selecting it from the Tools menu:

enter image description here

Switch back to Mathematica and click the 'Copy to Clipboard' button from the EmbedCode object output cell.

Then paste the code into the script editor windows (Code.gs file), overwriting the small code template that is already present in that windows. Then save the file:

enter image description here

Now switch back to the spreadsheet and click on cell A1 and type:

=wolframCloudCall(42)

enter image description here

And then hit enter. The cell A1 will display loading for a short while and then display the answer of 42^2:

enter image description here

POSTED BY: Arnoud Buzing
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract