Syncing Group with Google Sheet

113 views
Skip to first unread message

Gabriel Clifton

unread,
Sep 16, 2024, 6:16:14 PM9/16/24
to GAM for Google Workspace
I have a Google Sheet with three columns: headers, group, role, and email. I have been trying to figure out a command to sync any group membership changes. I have tried "gam redirect stdout ./MemberUpdates.txt redirect stderr stdout update group csvkmd gsheet us...@domain.com <DriveFileID> <SheetEntity> keyfield group subkeyfield role datafield email sync csvdata email" and I get an error that Data Not Retrieved: Not Found.

Ross Scroggs

unread,
Sep 16, 2024, 6:25:12 PM9/16/24
to google-ap...@googlegroups.com
Gabriel,

Send me a Meet/Zoom invitation.

Ross

On Mon, Sep 16, 2024 at 3:16 PM 'Gabriel Clifton' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:
I have a Google Sheet with three columns: headers, group, role, and email. I have been trying to figure out a command to sync any group membership changes. I have tried "gam redirect stdout ./MemberUpdates.txt redirect stderr stdout update group csvkmd gsheet us...@domain.com <DriveFileID> <SheetEntity> keyfield group subkeyfield role datafield email sync csvdata email" and I get an error that Data Not Retrieved: Not Found.

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/5d259444-9e64-4840-ad8d-192ce21ab094n%40googlegroups.com.


--

Yehuda Alexandroff

unread,
Sep 17, 2024, 8:25:03 AM9/17/24
to GAM for Google Workspace
I have many sheets for setting up my groups and making changes, and it all comes down to 2 sheets, one called "Remove" and one called "Add", with two columns, one called "groupaddress" and the other called "emailaddress", then on my Mac I run:

Add

gam redirect stdout - multiprocess redirect stderr stdout csv gsheet <<sheetowner>> <<sheetid>> "Add" gam update group "~groupaddress" add member "~emailaddress"

Remove

gam redirect stdout - multiprocess redirect stderr stdout csv gsheet <<sheetowner <<sheetid>> "Remove" gam update group "~groupaddress" delete user "~emailaddress"



Gabriel Clifton

unread,
Sep 17, 2024, 8:28:48 AM9/17/24
to GAM for Google Workspace
Thank you. Ross ended up figuring out what went wrong. I forgot to add "id:" to "gam redirect stdout ./MemberUpdates.txt redirect stderr stdout update group csvkmd gsheet us...@domain.com <DriveFileID> <SheetEntity> keyfield group subkeyfield role datafield email sync csvdata email" making it "gam redirect stdout ./MemberUpdates.txt redirect stderr stdout update group csvkmd gsheet us...@domain.com <DriveFileID> id:<SheetEntity> keyfield group subkeyfield role datafield email sync csvdata email"

This allows me to have a Google Sheet listing everyone that should be in the groups and the sync will automatically remove or add anyone according to the list.
Reply all
Reply to author
Forward
0 new messages