r/GoogleAppsScript • u/phidgeteer2023 • Apr 15 '25
Guide Logging Sensor Data to Google Apps Script (Phidgets)
This guide offers a starting point for logging sensor data to a Google Sheet:
https://www.phidgets.com/docs/Google_Apps_Script_and_Phidgets
r/GoogleAppsScript • u/phidgeteer2023 • Apr 15 '25
This guide offers a starting point for logging sensor data to a Google Sheet:
https://www.phidgets.com/docs/Google_Apps_Script_and_Phidgets
r/GoogleAppsScript • u/mudderfudden • Apr 14 '25
EDIT: My Spreadsheet has multiple sheets. We'll say this is for the sheet (or tab, however you want to put it) called 'MySheet', not just for the Active Sheet.
EDIT #2: Solved.
Code:
const header = SpreadsheetApp
.getActiveSpreadsheet()
.getSheetByName('NumberingTest')
.getRange("1:1")
.getValues()[0]
.filter(String)
.slice(-1)[0];
Logger.log(header)The original sample, provided by u/WicketTheQuerent got the "Active Sheet" only, the modified code above uses a specific sheet name. The sample also was written as a function, the above example is not. To create a function:
function MyLastHeader() }
<Insert code here>
}See table:
| Date | Heading 1 | Heading 2 | Heading 3 |
|---|---|---|---|
As you can see, I have a table above, with four columns with headings. There is data in column 6, where there is no heading.
I want to return the value of A4, which is going to be the last column of row #1, where my column headings are.
How can I focus on a specific row number and return the contents of the last column containing data? The goal is to return "Heading 3" and not a blank indicating the contents of F1, since there is something in cell F3.
r/GoogleAppsScript • u/afdm74 • Apr 14 '25
I'm doing a financial control "system" for a client, using the already in use spreadsheet model he uses, the people there are not really tech savvy and was asked to not deviate much from what is already established. Basically, I'm doing automations in the background and importing data to theses sheets.
I would really like to do a custom toolbar, with icons with custom options and dropdown's for navigation (a ton of sheets...). I already did some reasearch in the Google documentation, and they do not offer anyway of customizing the toolbar, or creating one that fit my needs.
One option would be to create a pseudo-toolbar at the first row of every sheet, but I think this is cumbersome and error-prone ...
Another option is to create a sidebar. In this specific use-case it would not work, as it takes to much screen space and they use two browser windows to view the dashboard sheet at the left and the sheet they are using on the right.
Have anybody found something that would permit something like that to be doable?
Thanks!
André
r/GoogleAppsScript • u/marchino123 • Apr 14 '25
Hi, please, can you help me through this voyage?
r/GoogleAppsScript • u/Upset_Mouse3193 • Apr 14 '25
I have a script which is very simple but takes about 14 seconds to run. Anyway to speed it up?
Script:
function onEdit(e){
if(e.range.getA1Notation() == 'E46' &&
e.range.getSheet().getName() == 'NetWorth Dashboard'){
e.source.getRange('H46').clearContent();
}
}This is in a workbook with 40 sheets. The E46 is a selector via data validation for a chart and H46 is a data validation list that changes bases on E46. So once E46 changes, anything selected in H46 is invalid and so needs to be cleared out.
TIA.
r/GoogleAppsScript • u/Decipher_Talks • Apr 14 '25
So I made an apps script that sends emails using a spreadsheet and whenever i execute the code it sends it in plain text mode such that when you view it from a computer it jumps to a new line every 12-15 words. What should I do? I have disabled plaint text mode on my account by going to Compose, clicking the 3 dots and making sure the plain text mode option is unchecked. for reference here is the code:
function sendEmails() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var data = sheet.getDataRange().getValues();
for (var i = 1; i < data.length; i++) { // Start from row 2 to skip headers
var email = data[i][0].trim(); // Email Address
var subject = data[i][1].trim();
var messagePart1 = data[i][2].trim(); // First variable section
var messagePart2 = data[i][3].trim(); // Second variable section
var message = "Hello Coach " + messagePart1 + ", \n\nMy name is Mo F, and I am a student athlete at Western High School in Townsville, CA. I am a part of the 2026 class and play Linebacker. I have a strong interest in " + messagePart2 + " and would love the opportunity to perform in front of you and learn more about your program.\n\nYou can reach out to me at: \n\nCell: (555) 867-5309 \n\nTwitter/X: f_mo \n\nEmail: fmo@gmail.com \n\nThank you for your time and consideration. I know you have a busy schedule, and I truly appreciate your attention. I look forward to the opportunity to connect and wish you the best of luck next season.\n\nBest regards, \n\nMo F http://blank";
MailApp.sendEmail(email, subject, message);
}
}r/GoogleAppsScript • u/Former_Elk7092 • Apr 13 '25
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 • u/geminiikki • Apr 12 '25
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?