Generate Google Doc output

Several excellent posts on these forums around the subject of Google AppScript integration with appsheet. There are a variety of use cases for this. Here are some excellent examples and forum posts:

Yes, yes we all know it’s not very “no code” to add a google script to your appsheet solution :slight_smile: no arguments there. Anyway, I’ve always been curious as to the inner workings of appscript. In my spare time recently, I figured out a way to create a Google Doc from appsheet data. Spoilers/Warnings:

  • this solution requires the AppSheet Rest API.
  • this is a code solution, it’s not for the faint of heart. You need some moderate understanding of app script.

This solution solves for a particular missing workflow output type of “Google Document”. I didn’t see anything on the forums on this, so hopefully folks find it useful. Perhaps at some point in the future AppSheet will natively be able to render a Google Doc (from a Google Doc template of course).

As a side effect, this solution also solves the fact that currently the AppSheet PDF output cannot include headers, footers or pagination. Something @Jonathon went to great lengths to solve in a different forum post.

Here’s the code and readme:

For you folks with massive talents on app script code greater than mine, let me know if you see anything that I could improve.


// these next few lines overcome a google drive limitation of always creating documents at the top level
// herein, we 1. create a doc, 2. copy it to a designated folder “outputfolderID” and 3. remove the original from the top level
// kind of janky

…still reading, but this gave me a chuckle. This is awesome though. Thanks for documenting all of this!

1 Like

Awesome! When I get a chance to get back to the AppSheet world I’ll definitely look into this.

I’m a huge fan of breaking the no-code boundary if the implementation seems reliable. Just adds more options.


I was planning to develop something similar but you beat me to it!! Thanks.


Hey Ty, You are really a smart man. I knew it when we met first time. A quick question. Is there a way to return the Created Google doc file ID to corresponding column so that we can access the URL inside of appsheet itself ? Thank you in advance.

We do this already in the example script:

on line 42 we set the google ID:

which was returned from the rest of the code sample, e.g. line line 172:
var results = [finalDoc.getId(), finalDoc.getName()];


Thanks a lot Ty. I will sure get back if i have any doubt.