Document Management by ID not Filepath

I have a fairly complex app that does many things including management documents. Once a document is uploaded to a specific file I want to rename it and keep track of it's location just in case it is moved in the file system.

Currently to do that I have a script that finds to the document based on the file path that appsheets creates, renames the document based on an algorithm and gets stores it's google drive id in a table.

This seems like a VERY cumbersome way to manage documents. Is there a native option:

  • for forcing a naming convention on a document when it is uploaded in place of the appsheets default?
  • for getting a document id when it is uploaded?

Lastly - how do I trigger a google script on a document specifically, when it is uploaded? Right now my codes just pages through lists of documents and maintains master lists...but there MUST be a better way! Help please!

0 3 143
3 REPLIES 3

You might look at AppSheets feature to use a Google folder as a table datasource.  In my opinion, we shouldn't need to worry about the file names themselves but I don't know your reason for renaming files.

Use data from Google Drive

Great question. The files are renamed because there is a use-case where humans are interacting with them as a file system in the google drive.

Curious about the folder as table data-source option. I have not looked into that.

There's this:

https://www.googlecloudcommunity.com/gc/Tips-Tricks/More-User-Friendly-Image-names-for-images-upload...

Why do you find your setup cumbersome? Sure, it was a bit more difficult to develop than functionality in a low-code platform, but once it is set up, what's wrong with it?


@suredoes wrote:

how do I trigger a google script on a document specifically, when it is uploaded? Right now my codes just pages through lists of documents and maintains master lists


You can trigger the GAS to run via onChange, or from a Bot.

 

Top Labels in this Space