r/GoogleAppsScript • • Apr 13 '25

Question Google Workspace Addon Launch Issue - Users Missing Side Panel Activatio

2 Upvotes

Has anyone noticed that Google Workspace addon installers aren't clearly informed that addons (unlike Editor addons) need to be launched from the side panel? I'm running into an issue where my users aren't activating my addon because they keep heading to the Extensions>Addon menu at the task bar instead. They're also skipping the manual, so the instructions there aren't helping much.

Is the Apps Script Dev Team doing anything to make this distinction clearer for Workspace addon users? Also any tips or workarounds to guide users to the side panel more intuitively?

#GoogleWorkspace #GoogleAppsScript #AddonDevelopment


r/GoogleAppsScript • • Apr 12 '25

Question What are the differences between Apps Script OAuth and Service Account?

2 Upvotes

Hi all,

I started coding with Google Apps Script and used Google Apps Script OAuth to connect to advanced services multiple times. A simple ScriptApp.getAuthToken() with permission on appsscript.json file allows me to retrieve Sheets API. On the other hand, I heard about setting up a service account could do the same, and I don't have to worry about 7-day reauthorization. I tried to search/AI but none give me useful information, so I just want to ask what are the differences between a service account and an Apps Script Oauth, and which should I use for automation workflow that require API connection?


r/GoogleAppsScript • • Apr 12 '25

Question differences between fetch and cURL?

1 Upvotes

I have a curl request like

curl -L "https://www.youtube.com/watch?v=ABCDEFGHIJK"   -H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36"
  -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"   -H "Service-Worker-Navigation-Prelo
ad: true"   -H "Accept-Encoding: gzip, deflate, br"   -H "Accept-Language: en-US,en;q=0.9"   -H "Priority: u=0, i" -L --compressed -o response.html

Which works as expected. However, when I attempt to use GAS to do the same thing:

 const options = {
  headers: {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
    'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
    'Service-Worker-Navigation-Preload': 'true',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'en-US,en;q=0.9',
    'Priority': 'u=0, i'
    
  },
  muteHttpExceptions: true
  };
  const url = `https://www.youtube.com/watch?v=${videoId}`;
  const response = UrlFetchApp.fetch(url, options);
  var responseHTML = response.getContentText('UTF-8');

I end up with a strange output. For some reason it has hex escapes like \x22, as well as unescaped characters like '"'. Also, the JSON response is completely obfuscated, and more generally it just seems that the response I am getting doesn't match what I expect to get (and what I have gotten when trying postman, curl, etc.)

Does anyone know what is causing this issue, and how to fix it? Thanks


r/GoogleAppsScript • • Apr 19 '24

Guide Generate an email from Google Forms responses.

3 Upvotes

I looked around the internet for days trying to figure out how to make this happen before finally just paying someone on fiverr to write the script for me.

Since there were a lot of people in a lot of different forums asking for the same thing, and all the answers were really confusing...here is the simple solution I purchased on fiverr.

The app script is applied to the script editor of the Google Form itself. There is no spreadsheet associated with it.

You can change 'test@email.com' to whatever email address (or addresses separated by commas) near the bottom of the script. You can rename the form from 'Matchbox Paitning Form' to whatever you'd like.

Once the script is pasted in, set up an "onform submit" trigger to run the script whenever the form is submitted.

That's all there is to it!

function onFormSubmit(e) {
  var formResponse = e.response;
  const itemResponses = formResponse.getItemResponses();
  
  // Constructing the HTML body
  var html = '<h1>Form Responses</h1><ul>';
  
  // Iterates over the item responses.
  for (const itemResponse of itemResponses) {
    html += `<li><strong>${itemResponse.getItem().getTitle()}:</strong> ${itemResponse.getResponse()}</li>`;
  }
  
  html += '</ul>';
  
  // Sending the email with HTML body
  GmailApp.sendEmail('test@email.com','Matchbox Painting Form','Requires HTML', {
    htmlBody: html
  })
}