Get a Google Docs Body Text with Apps Script

Retrieving a Google Docs body text is quite easy with the help of Google Apps Script.

Well, until it isn’t. Let me explain.

Continue reading “Get a Google Docs Body Text with Apps Script”

Why can’t I edit this Google Sheet that was shared with me? 🤔

You’ve probably come to this page feeling pretty frustrated that you’ve received a link to a Google Sheet, Google Slide or Google Doc in an email or found a link to one of these documents in a website or even one of my tutorials, but you just can’t edit it. You can’t update the text and even half of the menu bar is greyed out!

Naaarggghhhh!!!!

What’s going on?

It means that you have been given only View permissions to this document.

Why?

Generally, it’s because any changes in a Google Workspace Document, (Sheets, Slides, Docs) will be displayed for anyone who has access to the document. So if you add or delete something in a document, then other editors, commentators and people with view-only access will see the change in near real-time.

https://yagisanatode.com/2020/11/25/google-sheets-beginners-sharing-your-sheet-20/

There are three main reasons why an owner of a document will provide View-only access to users:

1. It might have only been meant for you to read-only.

Maybe you get an email from another department from work with a new policy that they have. You don’t really need to make edits to this. You just need to read it, right?

If you think this might be the case, but you want to be able to access the document in your personal folder, you can go to File > Add a shortcut to Drive. This will save a short cut to the file in your own Google Drive to help you to better organise your documents.

You still won’t be able to edit the document, but you don’t need to.

Also, the owner or the editors of the documents can also make copies of the document after you have made the shortcut if they need to.

2. It might be an example document or template.

In my tutorials, I often provide links to templates or example documents. Here again, I only ever provide view access.

However, you can create your own copy of these documents easily, by going to File > Make a copy. You will then be prompted to move the copy into a desired folder in your Google Drive.  Once done, a new window will appear in your browser. You will then have your very own copy of the document that is owned by you. You can now edit it and it will not affect the original document, because they are two separate documents.

3. The owner may have forgot to make you an editor.

Maybe the owner of the document was meant to give you edit permission but may have forgot.

Now before you get too excited, there is one thing you might want to check to save yourself some embarrassment. Go up to the top of your sheet and check to see if you are using the correct account for this sheet. You can do that in the top-right corner of the document and confirm you are using the right avatar.

Perhaps the owner has given you edit permission to the document in another one of your accounts, like a work account.

If you are in the wrong account, simply change to your correct account and check to see if you have edit permission.

If you are in the correct account and you are certain you should have edit permission, then you can select the View Only button and then click Request view access. An email will be sent to the owner and they can decide if you need edit access.

Why so much build-up to this last option? Well, you can imagine that it can be a little frustrating to get a bunch of emails from people who don’t actually need edit access.

Fortunately, there is a workaround to receiving a bunch of emails requesting edit access unnecessarily. Check out the tutorial below:

https://yagisanatode.com/2019/09/07/how-to-stop-getting-google-document-requests-to-edit-from-users-outside-your-organisation-from-publically-viewable-files/

Check out the video:

 

Did you enjoy the tutorial? Want to upskill and get a solid step-by-step course to become a pro at Google Sheets? Check out my course, Google Sheets: Learn the Essentials with Three Detailed Projects. Sign up today.

 
Google Sheets Shortcuts Mousepad
Google Sheets Shortcuts Mousepad
Want a fast track to boost your Spreadsheet efficiency? Grab one of these handy Google Sheets Shortcuts mousepads that I created from my store.
Google Sheets Shortcuts Mousepad Gel
Google Sheets Shortcuts Mousepad Ge

~Yagi

Google Apps Script: Create multiple versions of a document based on Google Sheet Data and a Google Doc Template (Mail Merge)

Google Apps Script: SpreasheetApp, DocumentApp, DriveApp; Google Sheets, Google Docs

If you have ever worked in LibreOffice or Microsoft Excel you will probably be familiar with the mail merge. Traditionally, mail merge is used to create multiple versions of a document and snail-mail them to someone.

These days, we don’t often use the snail mail approach, but it is a regular occurrence for us to need to produce multiple versions of reports based on a data set usually from a spreadsheet.

In this tutorial, we will create a document merger that will create new Google Documents based on a dataset from a Google Sheet using Google Apps Script.

If you want to quickly jump into your own project with our script, I’ll provide you with a quick-use guide.

Then, we will set up a template for our Google Doc and generate our Google Sheet data (don’t worry, I’ll share the document so you can follow along).

Finally, we will jump into the breakdown of the code for those legends who are learning how to create their own Google Apps Script.

Let’s get started:

Note: As always, take what you need and don’t worry about the rest. 

Continue reading “Google Apps Script: Create multiple versions of a document based on Google Sheet Data and a Google Doc Template (Mail Merge)”

Google Apps Script: Get Google Doc Text Based on Reference Characters

Google Apps Script: Google Docs, Document App. Javascript: Spread syntax, Set, IndexOf, Substring

So here is the scenario, imagine you have a big Google Doc. You want to get a list of information from the document that you have noticed are between two sets of characters. Maybe something like this:

  1. You want to grab all the quoted text in a story and you know that the quoted test is between two sets of quotation marks: “ ”.
  2. You want to grab citations or asides inside different braces, for example, [],{} or ().
  3. You are making a mail merger and you want to grab a specific list of words that the user put in that is to be substituted based on special character identifiers, for example, {{name}}, {{phone}}.
  4. You want to grab all the websites in a Google doc and you know they start will start with https:// and with .gov .

This tutorial provides a simple how-to do this.  Perhaps the code is exactly what you need for your project. We’ve set it up in a way that is easy to implement in your own project.

Continue reading “Google Apps Script: Get Google Doc Text Based on Reference Characters”

How to stop getting Google document requests to edit from users outside your organisation from publicly viewable files. (Updated Feb 2022)

G Suite – Paid editions, Gmail, Google Sheets, Google Docs, Google Slides, Google Drive

Recently, I had updated all the course materials in a learning management system (Not Google Classroom. Sorry Google) to only use Google Workspace files like Docs, Sheets and Slides for students to access.

For me, this was a pretty logical step. It allowed course creators to update their files live when they had to correct errors or make minor changes quarter-to-quarter or year-to-year. Administratively, it meant that files did not have to be accounted for, deleted and updated every time a change was made.

The Problem

While time-consuming, the changeover went well as we changed all of the student resources into Google files. We set all the files to be accessible to anyone with the link can view (The organization does not have student accounts on the same domain as the staff).

Google sharing settings

However, in the back of my mind, there was a problem I knew I needed to address. The dreaded request for access to edit. With over 3,500 students on the program and hundreds of files for them to access, it would be a huge pain if some of these students clicked that view and requested edit access.

Google Docs View Only - Request Edit Access

There is no way to prevent users from not being able to do this within the document’s share options. Likewise, my organisation may want to allow requests inside the domain (for example name@yagisanatode.com is okay, but name@gmail.com is not).

The Solution – Gmail Filters

Continue reading “How to stop getting Google document requests to edit from users outside your organisation from publicly viewable files. (Updated Feb 2022)”