ScriptDB as a dead drop

NOTE: ScriptDB is now deprecated. Please take a look at Database abstraction with google apps script for alternatives.

On this site, there are a a number of times that I generate a web page directly from Excel, then navigate to that page. There is no connection between the original Excel data, and the web page to be able to provide a feedback loop. Here's a way to combine scriptDB API for JavaScriptA VBA API for scriptDB and of course the native Google Apps Script scriptDb access so that we have a deaddrop to pass messages and data between each of these platforms. 

Here's a slideshare primer to introduce the concept.

Example use Case

Here's how something like this might work. Elsewhere in this site, you'll see how to interact with Google Maps and Google Earth using a webapp directly generated from an Excel Workbook. It goes something like this. Fine, but there is no opportunity to collect data from the Mapping application and feed it back to Excel.

However, if the webapp was instrumented to be able to record data in a temporary drop box, then we could complete the feedback loop and use such a web app to enrich the original Excel data. 

In this section, I'll show you how to implement this using scriptDB API for JavaScript and A VBA API for scriptDB. You could of course instrument any co-operation scenario between any of Google Apps Script, javaScript and VBA using this technique. For this one I'll be enhancing Integrating Excel with Maps and Earth

Properties of solution

  • The deaddrop concept is not supposed to be a replacement for permanent database lookup. If you want that, you can use traditional database methods, or just use scriptDB API for JavaScript and A VBA API for scriptDB to create a noSQL database structure.
  • Because of this a message lifetime of 24 hours is enforced. Keys will become invalid 24 hours after they are created, and any data in the dead drop  will be automatically deleted. 
  • Although you will use a public scriptDB to play around with, I recommend that you read Creating your own scriptDB environment and make your own closed environment if you plan to do anything with this capability.

Details of implementation

Although I'm using scriptDB as the deaddrop here, I could also implement this on (i probably will), since we also now have - nosql database for VBA and - noSQL database for GAS. The differences will be fairly trivial. Watch this space if is your preferred thing.

You can get me on Google plus, Twitter or this forum, and compare this topic with A VBA API for scriptDB
For help and more information join our forumfollow the blogfollow me on twitter