PIcture by Pixabay

TSDynamicUrls (#3) — Leverage the URL Power of Google Docs, Sheets, Slides, Drawings & Forms 💥

Laura Taylor
5 min readJul 28, 2021

--

In a previous post, I outlined the power of Google document URLs to perform “Simple, Powerful, Work” and promised to share several tools I’ve developed to aid in building them.

The first of these tools is TSDynamicUrls — an Apps Script powered dynamic URL generator hosted in Google Forms. See this post for more information.

The second tool is TSCreateUrlCheatsheet — a Google Sheets macro for creating a Google Workspace new resources shortcuts cheatsheet. See this post for more information.

In this post I’ll introduce a companion TSDynamicUrls tool hosted in a simple App Script web application.

Diagram 1 — TSDynamicUrls Web App

TSDynamicUrls — An Overview

As discussed in previous posts, Google document creators can make simple modifications to shared URLs of Docs, Sheets, Slides, Drawings and Forms to transform them into entirely new resources. These resources can be distributed to document consumers to leverage their URL power.

Google document creators are assisted in maintaining single sources (i.e., the original Google documents) while at the same time possess confidence that document consumers are receiving the latest version in the desired resource formats.

Diagram 2 — Document Transformation Options
Diagram 3 — Google Sheets Transformation Options

But remembering all the possible URL transformations for these formats is difficult. As it turns out there are a dizzying number of options available (see Diagrams 2 & 3). That’s why I created tools to assist in the process.

Just as users are enabled to transform URLs through the TSDynamicUrls Google Form, they can perform the same operations through the web application. Additionally the web application can be run as a standalone web application or be embedded in a Google Site.

TSDynamicUrls — Getting Started

To Install TSDynamicUrls:

  • Login to Google Drive.
  • Click TSDynamicUrls Google Sheet. This will open the TSDynamicUrls Google Sheet template.
  • Click the USE TEMPLATE button in the top right.
  • Wait for the form to be copied to your Google Drive.

To Deploy TSDynamicUrls:

  • Locate and open the newly copied TSDynamicUrls Google Sheet in your Google Drive.
  • Wait for the sheet to fully load.
  • Select ToolsScript editor from the Sheet’s menu.
  • Select the Deploy button → New Deployment in the top right corner
  • Select the application type as Web app and fill in the appropriate information
  • Click the Deploy button
  • Copy the URL for the newly deployed TSDynamicUrls web application

TSDynamicUrls is now deployed! Share the web application link with members of your organization and empower document creators to leverage the URL power of Google documents.

TIP: Embed TSDynamicUrls web application in a Google Site so it’s easily accessible within your organization.

Once the TSDynamicUrls form is installed and deployed, Google document creators within your organization can take advantage of it by following these simple steps:

  1. Create a Google document (Docs, Sheets, Slides, Drawings & Forms).
  2. Appropriately share the Google document based on audience.
  3. Copy the Google document URL (from the document sharing settings or from the open document browser address bar).
  4. Complete the TSDynamicUrls web application using the copied Google document URL.
  5. Use the URL generated to be shared with document consumers.

Following are key items to keep in mind when using TSDynamicUrls:

Google Sheets URL transforms for CSV (comma-separated values), TSV (tab-separated values) and individual sheet PDFs require a sheet ID to be included in the submitted URL. To get this sheet ID:

  • Open the Google Sheet with URL to be transformed
  • Navigate to the desired sheet
  • Copy the URL from the document browser address bar

The URL should contain a sheet ID as highlighted below.

https://docs.google.com/spreadsheets/d/1TxINLwjEkB8QnsaGgKpzvV_VjtFYHVmhPqdB5hFjC3E/edit#gid=929929678

Google Slides URL transform for individual slide PNG images requires a slide ID to be included in the submitted URL. To get this slide ID:

  • Open the Google Slides with URL to be transformed
  • Navigate to the desired slide
  • Copy the URL from the document browser address bar

The URL should contain a slide ID as highlighted below.

https://docs.google.com/presentation/d/1S5pu1SC1VmhDYxJppLVFTCBqaLftiedCKKk43yYpHgo/edit#slide=id.gc6fa3c898_0_5

Here are important items when using Google Sheets PDF:

> Repeat Frozen Rows — frozen rows must be specified on the sheets to be transformed

> Repeat Frozen Columns — frozen columns must be specified on the sheets to be transformed

> Custom Margins — all four margins must be specified

> Named Range — the named range must exist on the sheet to be transformed or the generated URL will be invalid

> Custom Range — start row and start column must be less than or equal to the end row and end column, respectively, or the PDF URL will default to the entire sheet

A CAUTION WHEN SHARING GOOGLE FORMS:

Most Google document types allow file sharing with view only access. Google Forms by default are shared with edit only access.

Edit only access can be problematic when sharing a Google Form copy or template link with users (especially outside your G Suite organization). Anyone possessing the shared link can turn it into an edit link and modify your Google Form.

Follow this guide to share your Google Forms with view only access.

Looking for the code?

See the TSDynamicUrls project on Github.

Need help automating processes inside your G Suite organization? Get in touch

Follow me on Twitter, Medium & Github.

Enjoy this post? Please consider buying me a coffee. Thank you!

--

--

Laura Taylor

Google Developer Expert for G Suite passionate about Workflow Automation and Productivity — https://www.tech-streams.com