r/GoogleAppsScript • u/SnooSuggestions1582 • Jul 31 '25
Question Struggle with referencing class objects
I have created a class with employee first amd last name as well as referencing their specificetrics sheet.
For instance
const bob = new class("Bob", "Smith", "Bob's sheet");
I want to pull data from a report and put it on bobs sheet but I am also trying to minimize code.
If I creat a loop to go through all the rows and set the value for:
var name = sheet[1]; as an example for the column with the name, can I call on Bob's data using name.firstname or do I always have to use bob.firstname.
I want to shrink my code so I dont have to have a manual code segment for each employee.
View all comments
Show parent comment
1
u/SnooSuggestions1582 Aug 01 '25
I'll be honest, I am entry level at best and rely on for and if statements a lot. I am just learning classes so I will have to take what you said and do some research.