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/True_Teacher_9528 Aug 01 '25
No worries, let’s try to figure this out. Would it be possible to store the user specific general info (like their sheet index number) in propertiesservice? Then have a condition to add to the object storing those indexes if you add team members?