Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
Does Google Apps Script Session Information Work Different for Gmail accounts vs other Workspace Domain Accounts?

I'm writing a signoff script in Google Apps Script for GSheets that allows users to select their name from a dropdown list in a cell, then if the name matches the currently active account, another function will run to lock the row etc. Everything is working perfectly on my gmail account, but when the client tries to run the script using an account managed by google but with a non-gmail domain, the email address check fails. I'm waiting on the client to send me the log info as I don't have permissions to access it in their file, but wanted to see if anyone else had run into this issue.

In the example code with modified company and username, the code does NOT work, but if I set atDomainString to "@gmail.com" and name to my gmail address and run under my account, it does.

const atDomainString = "@redactedcompany.com";
const name = "JSmith";

    function userMatchesSignature(name) {
      let user = Session.getEffectiveUser().toString().toLowerCase();
      let signUser = (name + atDomainString).toLowerCase();
      Logger.log("User: <"+user + "> vs <" + signUser +">");
    
      return user === signUser;
    }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try to grab their error message to confirm what's going on. But most likely they're blocking access to the client ID. Since the scripts that try to access user data might be blocked.

Depending on the scopes you're using on your project, they might need to verify the app https://support.google.com/cloud/answer/7454865

Best practice

  • Create the project using a domain account instead of a free Gmail account. Because they might run into scopes issues. In their domain, they can mark the app as internal.
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!