Is there a way to bulk update Employee type and cost center?

2,371 views
Skip to first unread message

Daniel Warren

unread,
Aug 22, 2017, 1:43:00 PM8/22/17
to GAM for G Suite
I am using gam with a csv to update some custom fields that I have in google.  I also would like to update the Employee type field to be the same for all users on that csv.  And the last thing is I would also like the cost center to be the same for all users on that csv.  To be clear the custom fields are updating fine, but I get an error 400 on the employee type and cost center.  Here's what I have right now:

gam csv KYOG2022_FY18.csv gam update user ~"mail" Private_User_Details.User_ID ~"id" Private_User_Details.Printer_ID ~"printerid" Organizations.description "Student" organization costcenter "YOG_2022"

Any insight would be great.  Thanks

Ross Scroggs

unread,
Aug 22, 2017, 2:28:16 PM8/22/17
to google-ap...@googlegroups.com
Daniel,

By employee type do you mean organization description?

gam csv KYOG2022_FY18.csv gam update user ~mail Private_User_Details.User_ID ~id Private_User_Details.Printer_ID ~printerid organization description "Student" costcenter "YOG_2022" primary

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/3fe14ac9-2b4e-4233-a1ec-0bdeede83fe1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Daniel Warren

unread,
Sep 14, 2017, 10:53:47 AM9/14/17
to GAM for G Suite

Under Employee details there is a Type and Cost Center field I want to populate those in bulk using a csv file.



On Tuesday, August 22, 2017 at 2:28:16 PM UTC-4, Ross Scroggs wrote:
Daniel,

By employee type do you mean organization description?

gam csv KYOG2022_FY18.csv gam update user ~mail Private_User_Details.User_ID ~id Private_User_Details.Printer_ID ~printerid organization description "Student" costcenter "YOG_2022" primary

Ross
On Tue, Aug 22, 2017 at 10:42 AM, Daniel Warren <dwa...@natickps.org> wrote:
I am using gam with a csv to update some custom fields that I have in google.  I also would like to update the Employee type field to be the same for all users on that csv.  And the last thing is I would also like the cost center to be the same for all users on that csv.  To be clear the custom fields are updating fine, but I get an error 400 on the employee type and cost center.  Here's what I have right now:

gam csv KYOG2022_FY18.csv gam update user ~"mail" Private_User_Details.User_ID ~"id" Private_User_Details.Printer_ID ~"printerid" Organizations.description "Student" organization costcenter "YOG_2022"

Any insight would be great.  Thanks

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.



--

Ross Scroggs

unread,
Sep 14, 2017, 11:06:24 AM9/14/17
to google-ap...@googlegroups.com
Daniel,

        (organization|organizations clear|([type domain_only|school|unknown|work] [customtype <String>] [name <String>] [title <String>] [department <String>] [symbol <String>]
                [costcenter <String>]  [location <String>] [description <String>] [domain <String>] notprimary|primary))|

Assume a CSV file Users.csv:
User,Type,CostCenter
f...@bar.com,IT,Tech
g...@bar.com,Support,Maintenance
...

If you want one of the predefined types:
gam csv Users.csv gam update user ~User organization type ~Type costcenter ~CostCenter primary
If you want a custom type:
gam csv Users.csv gam update user ~User organization customtype ~Type costcenter ~CostCenter primary

Ross


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Daniel Warren

unread,
Sep 15, 2017, 8:48:30 AM9/15/17
to GAM for G Suite
On my test run (just one user on this csv) I'm getting "Error 400:  Invalid Input:  Bad request for - invalid"

Here's what I'm entering in as a command:

gam csv Users.csv gam update user ~"Email Address" organization costcenter ~"Cost Center" primary organization customtype  ~"Employee Type" primary

I have the quotes since this is just an export from the users directory in the admin console and has the default headers.  I'm not sure if I need the primary argument twice, but when I tried just adding it at the end gam hung (on just one user).  Is there some way I can access gam 
Daniel,

Ross Scroggs

unread,
Sep 15, 2017, 9:26:06 AM9/15/17
to google-ap...@googlegroups.com
Daniel,

Don't repeat the organization keyword, that will give you two organizations. Then you got an error because you said both were primary.
Try this:
gam csv Users.csv gam update user ~"Email Address" organization costcenter ~"Cost Center" customtype  ~"Employee Type" primary

Ross

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Warren, Daniel

unread,
Sep 15, 2017, 10:11:23 AM9/15/17
to google-ap...@googlegroups.com
Thanks the cost center updated, but not the Employee Type.  I want it set to Student, which is what I have in the csv.

gam csv users.csv gam update user ~"Email Address" organization costcenter ~"Cost Center" customtype  ~"Employee Type" primary

Any ideas?

Daniel,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Daniel W Warren
Application Distribution Specialist
Natick Public Schools
(508)-647-6400 x1728

Ross Scroggs

unread,
Sep 15, 2017, 10:21:34 AM9/15/17
to google-ap...@googlegroups.com
Daniel,

$ gam update user testuser4 organization costcenter "Cost Center" customtype "Student" primary 

updating user test...@rdschool.org...

$ gam info user testuser4

User: test...@rdschool.org

First Name: Test

Last Name: User4

...

Organizations:

 customType: Student

 primary: True

 costCenter: Cost Center


This is what I get, what do you see?


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Daniel W Warren
Application Distribution Specialist
Natick Public Schools
(508)-647-6400 x1728

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Warren, Daniel

unread,
Sep 15, 2017, 10:22:55 AM9/15/17
to google-ap...@googlegroups.com
I did just try that command exactly and it updated the cost center, however it did nothing for the Employee Type.  I would like the employee type to Student.

On Fri, Sep 15, 2017 at 9:25 AM, Ross Scroggs <ross.s...@gmail.com> wrote:
Daniel,

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Sep 15, 2017, 10:26:42 AM9/15/17
to google-ap...@googlegroups.com
Daniel,

In the GUI, the field labelled Employee Type is really the description field.
gam csv Users.csv gam update user ~"Email Address" organization costcenter ~"Cost Center" description  ~"Employee Type" primary

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Daniel W Warren
Application Distribution Specialist
Natick Public Schools
(508)-647-6400 x1728

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Warren, Daniel

unread,
Sep 15, 2017, 10:32:39 AM9/15/17
to google-ap...@googlegroups.com
Okay so I guess it's doing what you expected it to do because a query to gam as suggested above yields this:

Organizations:
 customType: Student
 primary: True
 costCenter: BEN_2029

But that's not what I want.  I need to update the field Employee Type under Employee details.  I've attached a screenshot to clarify.  In this screenshot the Employee type is Test.  If you export a csv of multiple users from the google admin console this is the field headed with Employee Type.

Inline image 1

So gam is updating the organization custom type field, but that's not what I want.  I want to update the Employee details > Employee type field.





--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.

Warren, Daniel

unread,
Sep 15, 2017, 10:37:05 AM9/15/17
to google-ap...@googlegroups.com
Excellent!!!  Thank you very much for your time and patience that worked perfectly.




--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.

Tim Nethers

unread,
Nov 19, 2020, 12:19:15 PM11/19/20
to GAM for Google Workspace
We too are trying to update employee type using GAM. Can you clarify what worked? I saw you post a screenshot showing what field you were trying to update, then you said Excellent, thank you that worked! What worked specifically?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Daniel W Warren
Application Distribution Specialist
Natick Public Schools
(508)-647-6400 x1728

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Ross Scroggs

unread,
Nov 19, 2020, 12:47:28 PM11/19/20
to google-ap...@googlegroups.com
Tim,

This page shows the mapping between Admin Console user field names and Google API user field names.

Suppose you have a CSV file UserTypes.csv with columns: primaryEmail,employeeType
This command will update the employee type.
!!!!!! Note, this has the potential for wiping out other user fields: Cost center, Department, Job Title
gam csv UserTypes.csv gam update user "~primaryEmail" organization description "~employeeType" primary

Are you using these other fields? If so, you have to get those values and set those in the commands as well.

Ross



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/3b2b13ed-3b26-4c4e-a541-832ebd91081bn%40googlegroups.com.


--

Jose Antonio Garcia Barbera

unread,
May 19, 2023, 5:51:07 AM5/19/23
to GAM for Google Workspace
There is a chance to execute the command only to add the costcenter with a csv with only the email list?

CSV:

COMMAND:
gam csv allstaff1.csv gam update user organization costcenter "staff"

Thank you

Jose Antonio Garcia Barbera

unread,
May 19, 2023, 6:33:22 AM5/19/23
to GAM for Google Workspace
I finally find the solution:
gam csv allstaff.csv gam update "~email" organization costcenter "staff"

CSV:
  email
  ma...@domain.org
  ma...@domain.org
  ...

gam csv allstaff2.csv gam update "~email" organization costcenter "~costcenter

CSV:
  email,costcenter
  ma...@domain.org,"staff"

Thank you for all the comments that finally help me to complete the bulk process.
Reply all
Reply to author
Forward
0 new messages