Tuesday, 28 March 2023

Switch view to a specific Google Sheet

The following Google Apps Script code is designed to switch the active sheet that the user is currently looking at to that of another within the same Google Sheet file. This is a snippet of code that could be placed at the end of a function when archiving data from one sheet to another for instance, and you want the destination to be shown to the user.

Apps Script Code to switch the active view for a user
Apps Script Code to switch the active view for a user


Tuesday, 14 March 2023

Read & write multiple User Properties

The following Google Apps Script is a few snippets of some larger code where I needed to write (and then later read back) a number of User Properties in one go. Rather than creating multiple single write requests it is more efficient to do this in bulk.

I also needed a way to bulk read/extract these values later from a JavaScript Object that would allow me to easily call the Property name and get its value in return.

Access User Properties and get the values in an Object
Access User Properties and get the values in an Object