This guide is designed to help you quickly solve issues related to running scripts from custom-built dialogue boxes in Google Sheets, Docs, Forms and Slides, most notably, the “ACCESS DENIED” error and other related errors.
This guide is for Google Workspace users and not necessarily for Google Workspace Developers. If you would like to learn how to handle for these issues programmatically, check out the link here (Handling Dialog and Sidebar Access Issues in Google Workspace Apps).
Use this guide as a quick reference for troubleshooting your own problem or share it with a team member if they need assistance.
Table of Contents
The Video Guide
The Problem
In the cases below, the issue is generally caused when you are:
- Logged into multiple Google Workspace accounts. While the example below is a Chrome account this issue is just as likely to cause problems in Edge, Safari, Firefox, Brave, Opera and the rest.
- Logged into Chrome with one account (Or a browser profile) and logged into Google Sheets, Docs, Forms or Slides in another account. When you’re logged into Chrome with one account (or using a separate browser profile) and simultaneously logged into Google Sheets, Docs, Forms, or Slides with another account, it can lead to conflicts in how scripts handle frontend and backend user information. Specifically, when dialogues and sidebars run in Google Workspaces, they often rely on the browser login and the associated Google Workspace account. These two conditions—browser login and app-specific credentials—are distinct and may have different login credentials. However, if data from the user interface (UI) dialogue or sidebar is then processed using mixed credentials (i.e., a combination of both sets), it can result in process failures.
These issues are easy to miss in a busy workday but keeping an eye on who you are logged in as each time you work on a document will save you frustration in the future.
Let’s take a look a some of the issues that you might face that can provide clues to these underlying problems to help you troubleshoot better.
1. ACCESS DENIED – “You need access” I think I am logged in but I can’t access the spreadsheet
In this case, you try to log into your Google Workspace app and are greeted with a webpage explaining that you don’t have access.
Cause
You can see that you are logged into the correct account in Chrome, but if you check the message at the bottom of the webpage you can see that you are logged into this Google Workspace app (In our example, Google Sheets) with another account.
2. Nothing happens when I submit the form in the Custom Dialogue: “Uncaught” error
Let’s say you are filling out a custom form from a dialogue box in a Google Sheet and when you submit it, nothing happens. No warning dialogues, or errors.
First, head to your browser’s developer tools. In Chrome browsers you can hit ‘F12’ or ‘Ctrl + Shift + I‘ for PC or ‘⌘ + Shift + I’ for Mac.
- Select ‘Console’ from the menu options.
- Then clear the console (In Chrome this is ‘Ctrl + L‘).
- Now resubmit your form and watch what error occurs in the console.
- You should see an ‘Uncaught’ error message.
Cause 1: Chrome account has no access but the app account does have access
This is usually caused when your Chrome account does not have access to the Google Sheet but your account logged into the Google Sheet does have access.
Cause 2: App account has ‘Edit’ access but ‘Chrome’ account has ‘View’ or ‘Comment’ access
Another cause might be that the account you are logged into has ‘Edit’ access to the app but your Chrome account has ‘View’ only access.
Cause 3: Chrome Account had ‘Edit’ access but the ‘App’ account has ‘View’ or ‘Comment access: Uncaught at function_name
In this instance, you are likely to see more information in the developer tools console error. This will also contain the function that was called. This means that your Chrome account has managed to successfully submit your data back serverside for the Google Apps Script code to read but that Apps Script code is being executed under your currently signed-in app (Google Workspace) account causing a discrepency.
Cause 4: App account and Chrome account are different: Authorisation issue.
Your app account and Chrome account are logged in differently. Both have edit access to the app, but your Chrome account has not authorised the app to run.
Cause 5: App account and Chrome account are different
If your Chrome account has edit access to the same Google Workspace file and you are logged into another account you may get a slightly different “Uncaught” error with a function name appended to it. This occurs when the Chrome account has edit access and has gone through authorisation but the app account has not.
Script editors may find the error code: Exception: You do not have access to perform that action. Please ask the owner of this item to grant access to you.
3. Some data or options are supposed to load on my dialogue, but they don’t: “Uncaught” error
Perhaps there is supposed to be some data loaded onto your dialogue or sidebar, or you are missing options in a selection or dropdown.
This may be another example of the ‘Uncaught’ error in your Google Workspace app. Go into your developer tools (See issue 2 for how to do this) and see if you can find an ‘Uncaught’ error.
Causes
See the causes for issue 2.
4. View only access when I know I have Edit access
In this example, you open up your Google Sheet, Doc, Slide or Form only to discover you no longer have edit access to it.
Did the owner remove my permissions? Should I rage-request permissions and demand an explanation?!
Well, that’s probably a no. And considering you are the type of person who has spent time searching online for a solution, I dare say this is not you anyway.
Cause
What might be occurring here is that you are logged in in Chrome with the account you intend to access the app but are logged in on another account in your Google Workspace app.
4. You submit your data but you don’t get the response you were expecting or the data displayed is not what you were expecting.
This is a particularly tricky issue to detect. Imagine you have loaded a dialogue box with data just for your email, only to find data drawn from another one of your accounts or data that failed to load.
Alternatively, Imagine you have a sidebar form that submits a bunch of data into a Google Sheet and then sends an email to a client. The submitted form automatically takes your email address and then stores it in the Google Sheet and then uses that email to send the email. Unfortunately, you discover that the email being used is from the wrong account.
Cause
This likely occurs when both your Chrome account and your Google Workspace logged-in account have edit access to the Google Workspace file but they are different accounts.
Solution
In all of these example issues the overarching problem is that you are logged into two different accounts: one in Chrome and another directly within the Google Workspace app you’re currently using to access a file..
Here are four possible solutions with the first one probably the best.
Chrome Profile Manage
If you are working in Google Workspace apps in Chrome, then you can take advantage of Chrome’s Profile Manager.
The Chrome Profile Manager allows you to create separate profiles for your Chrome browser that will open independently of your other profiles. When you select a profile in your manager or by selecting your Chrome avatar and choosing from the other profiles, you will create an independent instance of Chrome just for that profile.
This ensures that you only have one Google account running at a time.
However, you will need to be vigilant and ensure that you don’t sign into other accounts under this profile.
Creating a new managed profile
To create a new profile:
- Click on your profile avatar in the top-right of your Chrome browser
- Click Add
Then follow the sign-in process to sign into your desired account.
Note! This is the topmost avatar in your Chrome browser bar and not the one you might find in your Google Workspace apps.
Other Browser Managed Profile methods
Other providers also have profile management systems, however, they will cater more to the needs of the ecosystem surrounding their browser. For example, Safari will manage profiles around Apple and Edge will manage profiles around Microsoft.
Having said that, these profile management tools can still be used to separate your Google Accounts by your profiles. Say you have a work profile on your Apple Mac and a personal profile. You could ensure that you are signed into your workplace Google account in your work Safari profile and then sign into your personal Google Workspace account on your personal Safari profile. You get the picture.
Check out the support pages for some of these below:
Log out of all of your profiles
If you are signed into multiple Google Workspace accounts at once in any browser whether it be Chrome, Safari, Firefox, Brave, Opera, Ladybird etc., it is recommended that you only remain logged into one account.
Sometimes Google struggles to recognise which account it should be running your dialogue or script in and will generate the issues mentioned above.
Signing out of all of your Google accounts and signing back into your required accounts is the next best option.
Unfortunately, Google takes a scorched-earth approach to signing out of your accounts that you have logged into in a browser instance. This means your only option is to log out of all of them and then either:
- Rely on your current Google Chrome browser sign-in (if you are using Chrome)
- Log back into the account that you need.
To log out of all of your Google accounts on your browser:
- Navigate to a Google Workspace App like Gmail, Google Sheets, Google Docs, or Google Slides and select your account icon in the top right.
- Select
Sign out of all accounts
.
You will be navigated to a new window informing you that you have signed out of every Google Account and, frustratingly, your Chrome browser account.
Now go ahead and either sign back into Chrome with your desired account if you are using Chrome or sign in again to Google on any other browser.
Go Incognito
Incognito mode is not just for those times you like to explore the wonders of the internet alone. Now you have a real excuse!
In this approach, we will log into our Google Workspace account using the incognito browser. This can also be a handy way to troubleshoot the issues you are facing with a dialogue or sidebar. If it works in incognito but not in your normal browser, then it is likely you have a sign-in conflict issue.
Logging in using incognito mode is also handy if you are borrowing another computer, so this is a useful tip.
All browsers have some form of incognito mode and the approaches to access them are quite similar.
For Chrome:
- Click on the 3 vertical ellipses (
⋮
) next to your profile icon in the top right of the browser. - Select
New incognito window
- The new incognito window will appear; often looking slightly different from your normal browser layout.
- Log into the browser. Your login will not be saved when you close this window.
Gotchas
One downside to this is that incognito mode will not normally allow cookies automatically. This may cause issues with your dialogues and sidebars if your developer is using cookies or local storage to keep important parts of your data quickly available to you.
You can restore cookie access by clicking the crossed-out eye icon in your URL bar and selecting the ‘Third-party cookies’ toggle. Then run the dialogue or sidebar again to see if all is working successfully. If not, it is then time to contact your friendly I.T. department or developer.
Ensure your Chrome profile matches your Google profile
If signing out of all of your accounts is all too much for you and you fear the very thought of it would require you to have a little lie down just to recover from the emotional anguish, then the absolute minimum you should do is to ensure that your Chrome account matches your Google Account.
No guarantees here, but in most cases, this ‘should‘ solve your problems.
To ensure that your Chrome login matches your Google Workspace login:
- Go up to the top right of your Chrome browser.
- Click on your profile avatar in the browser.
- Check the browser email.
- Now click below on the app avatar. You will need to be logged into a Google Workspace app like Gmail, Google Sheets, Google Forms, Google Slides.
- Compare the email with the browser email. Are you logged into the same account? If the answer is ‘yes’, then you are all good. If not,
- Sign out of the Google Workspace account ( the one in the app).
Here you can see that even though the avatars for the profiles are different, they share the same email. We have a match, people!
Conclusion
Bottom line, before giving up on a custom dialogue or reaching out to your developer it can be very simple to troubleshoot these issues. If you do have a login issue, then you are going to save yourself a little embarrassment and more importantly time, and log into just the one account. However, if the issue persists, then you can provide the developer or your I.T. team with a lot more information to help them fix any issues for you. Win-win!
If you experience any other similar issues, feel free to add them to the comments below. If they relate to login issues then I will add them into the guide.
~Yagi.