AppsScriptPulse

💩 ShiitCoin: Putting a blockchain on Google Sheets with Google Apps Script

Some ideas are bad, and then sometimes there are ideas so bad they actually go back around to being genius — we think we’ve come across one of those. Yes! We have an end to end blockchain working entirely off of a google sheet: transaction broadcasting, mining, wallets, gossip — all of it! ShiitCoin is (obviously) a troll project not meant to be rEaL mOnEy 💴 but we’re hoping to farm some internet points there’s some educational value to exploring the barebones of a blockchain which we’ll share here.

In pre-pandemic times I used to give a talk entitled ‘..you can do that with Apps Script’, which includes some more of the extreme examples of projects people tackle with Google Apps Script. This project by nalinbhardwaj (Nalin Bhardwaj) and Adhyyan1252 (Adhyyan Sekhsaria) definitely falls into the fun/interesting category and who knows you may find some interesting code snippets in the associated Github repo that might be useful … but no guarantees.   

Via Andrew Roberts

Source: ShiitCoin: Putting a blockchain on Google Sheets

Google Apps Script library for parsing HTML form objects and adding the values to a Google Sheet

This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

A common Google Apps Script use case is taking data from a webform and adding it to a Google Sheet. This can sometimes be quite painful has you have to handle the various input types and also write the data to the correct columns. The HtmlFormApp library makes this very straight forward and to illustrate once the library is added to your Apps Script project you can start appending data in a couple of lines of code:

// These are all options.
const obj = {
   formData: formData,
   spreadsheetId: "###",
   sheetName: "###",
   sheetId: "###",
   folderId: "###",
   headerConversion: {"header value of Spreadsheet": "name of HTML input tag",,,},
   ignoreHeader: true,
   choiceFormat: true,
   delimiterOfMultipleAnswers: "\n",
   valueAsRaw: true
};
const res = HtmlFormApp.appendFormData(obj);
console.log(res)

Click through to the source link for more details 👇

Source: GitHub – tanaikech/HtmlFormApp: This is a Google Apps Script library for parsing the form object from HTML form and appending the submitted values to the Spreadsheet.

Google Apps Script Release notes as an RSS Feed (scraping web pages with cheerio)

This enables you to register Apps Script Release Notes as RSS feed.

RSS data feeds might be less fashionable now, but I for one still rely on them as a way to aggregate and consume latest news. In a conversation with Pablo Felip and Kanshi Tanaike, this solution from Yuki Tanabe for turning the Google Apps Script release notes into an RSS feed was highlighted.  You can visit the source link for the RSS link to add to your feed aggregator.

Even if you are not a fan of RSS this project might be worth checking out as the solution implements the cheerio library for parsing/extracting content from HTML markup … or in other words a very simply way to use UrlFetchApp as a web scraper.

Source: GitHub – tanabee/google-apps-script-release-notes-feed: Apps Script Release notes RSS Feed

How to management deployments to Google App Script from clasp with a Github Action

This repository is an example of how to setup an automatic CI/CD process for Google Apps Script using GitHub Actions.

This solution come via Dimitri S on Twitter and provides a way to setup a continuous development workflow for Google Apps Script using clasp and Github. The basic recipe appears to be is you develop your code locally using your preferred IDE. You then use clasp to push your code to GitHub, which triggers a GitHub Action to deploy your code to script.google.com.

Source: GitHub – ericanastas/deploy-google-app-script-action

A Google Apps Script powered Google Chat Updates Bot

Keep up to date with any feed by having new posts published to a Google Chat room using Apps Script and Webhooks. Feeds included in this example are various official Google blogs.

This is a nice solution developed by Justin Wexler which provides an easy solution which can monitor a list of blogs and post any updates to a Google Chat room. The source post provides more detail on setup and how to use the code with your own Google Chat rooms. The code also provides a useful pattern for monitoring updates from RSS feeds.

Source: jdw353/google-workspace-apps-script-toolbox

Synchronous Class Dashboard with Apps Script – a personalized online interactive classroom

Andy Rundquist has created (and released as open source!) a synchronous class dashboard built entirely out of Apps Script.

As my school went mostly online last spring, I started collecting my thoughts about what I really wish I had for an online platform to work with my students. I quickly realized that my dream of all videos on and fully interactive students 1) wasn’t as good as I thought, and 2) didn’t happen because many students couldn’t or wouldn’t make use of video. I began to realize that video is the dominant feature in things like Zoom and Google Meets. It gobbles up nearly all of the screen space and is responsible for nearly all the bandwidth. So I started to consider what I might be able to do if I just stopped using video.

So I set out looking for ways to build in collaborative tools like whiteboards and understanding checks that would make better use of screen space. This is the result.

https://github.com/arundquist/synchronous-dashboard-with-jitsi

Andy’s full project is on GitHub is worth checking out.

New Google Apps Script library for working with Google Docs, MS Word, Google Sheets, MS Excel and Google Slides when core/advanced service methods are not available 

This is a Google Apps Script library for supporting Document service, Docs API, Spreadsheet service, Sheets API, Slides service and Slides API. The aim of this library is to compensate the processes that they services cannot achieve.

The purpose of this contribution from Tanaike is to extend Google Apps Script to interact with certain types of Google Drive files using methods not included in the existing core or advanced services. Features worth noting are:

  • Google Docs:
    • Retrieve table width and column width from the table. The tables inserted with the default width are included.
  • Google Sheets:
    • Retrieve all images in Google Spreadsheet as an object including the cell range and image blob.
    • Retrieve all comments in Google Spreadsheet as an object including the cell range and comments.
    • Insert images in cells of Google Spreadsheet using the image blob.
    • Create new Google Spreadsheet by setting the custom header and footer.
  • Microsoft Word:
    • Retrieve table width and column width.
  • Microsoft Excel:
    • Retrieve all values and formulas of the cells.
    • Retrieve all sheet names.
    • Retrieve all images as an object including the cell range and image blob.
    • Retrieve all comments as an object including the cell range and comments.

For more details about this library visit the source on Github

Source: tanaikech/DocsServiceApp

Google Doc to clean HTML converter for Google Apps Script

Export Google Doc as clean html. Handy to make a WordPress post from Google Doc. – thejimbirch/GoogleDoc2Html

Following on from our previous post highlighting Amit Agarwal’s Send Rich Text HTML Emails with Google Sheet  we received the following recommendation for a Google Doc to HTML converter solution from @IMTheNachoMan:

For those interested in workflows for using Google Docs as an email template this solution already has a emailHtml() function you can build on which appears to already inline images from your Google Doc.

Source: thejimbirch/GoogleDoc2Html

Retrieve previous versions of Google Apps Script projects

Photo by James Lee on Unsplash

Retrieve the source code linked to a specific version of your Apps Script project then save it as a new Apps Script project – RomainVialard/access-code-of-older-versions

Neat solution from Romain Vialard to retrieve a previous version of your Apps Script code. There is an open feature request to have this as a built-in feature of Apps Script (as noted by Romain recovering a previous script version is also possible using clasp using pull and an optional version number).

Source: RomainVialard/access-code-of-older-versions

RichTextApp – a Google Apps Script library for copying rich text formatting from Google Docs and Sheets

This is a GAS library for copying the rich text with the text styles from Google Document to Google Spreadsheet or from Google Spreadsheet to Google Document using Google Apps Script (GAS). And, also the rich texts in the cells can be converted to HTML format.

Nice little helper library for copying rich text formatting from Google Docs and Sheets. You can view the project README for information on the formats that are currently supported. Personally,  the inclusion of the RichTextToHTMLForSpreadsheet method looks particularly useful for converting rich text formatting in Google Sheets cells to HTML for mail merge applications.

Source: tanaikech/RichTextApp