Python Help

24 views
Skip to first unread message

Don Beck

unread,
Sep 8, 2025, 2:45:20 PM (7 days ago) Sep 8
to GAM for Google Workspace
Here is part of a larger python script I'm running with GAM7.
# Create user
  result = subprocess.run([GAM, 'redirect', 'stdout', LOCAL_LOGFILE, 'append', 'redirect', 'stderr', 'stdout',
                           'create', 'user', row['email'], 'firstname', row['firstname'], 'lastname', row['lastname'],
                           'orgunitpath', row['orgunitpath'], 'password', row['password'],
                           'organizations', 'type', 'work', 'name',  row["organization"], 'department', row['department'],
                           'title', row['jobtitle'], 'costcenter', row['costcenter'], 'primary',
                           'phone', 'type', 'work', 'value', row['phone'], 'primary',
                           'relation', 'manager', row['manageremail'],
                           'phone', 'type', 'mobile', 'value', row['mobile']],
                          check=False)
  if result.returncode != 0:
    sys.stderr.write(f'\nERROR: create user {row["email"]} failed')
    continue
------------------------------------------
I want to add this
'location', 'type','desk','area',row['location']
--------------------------------------------
but I'm getting an error on area no matter where I put it.
I'm trying to populate Locations>Desk>Area with data in the spreadsheet column called location.

Can't figure out what I'm doing wrong
Thanks
Don

Ross Scroggs

unread,
Sep 8, 2025, 3:50:41 PM (7 days ago) Sep 8
to google-ap...@googlegroups.com
You need endlocation
'location', 'type','desk','area',row['location'], 'endlocation'

Ross
----
Ross Scroggs



PLEASE NOTE
The information in this E-Mail message is legally privileged and confidential information intended only for the use of the individual(s) named above.  If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message.  If you have received this E-mail in error, please notify the sender. Thank you!

--
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 visit https://groups.google.com/d/msgid/google-apps-manager/e3991334-66c0-4fa8-bac1-a39f938e6201n%40googlegroups.com.

Don Beck

unread,
Sep 8, 2025, 4:02:00 PM (7 days ago) Sep 8
to google-ap...@googlegroups.com
Still getting errors, does it matter where in the script I put it?  Get errors on different components depending on where I put it.

 

Thanks,

Don

 

Don Beck

Director of Systems & Technology

Meriwether Godsey

(434) 258-1775 (cell)


 

 P Please consider the environment before printing this e-mail



You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/eEVtm1USzaw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/09461A52-175E-4465-9EA1-955C51C993BC%40gmail.com.

Don Beck

unread,
Sep 8, 2025, 4:21:24 PM (7 days ago) Sep 8
to GAM for Google Workspace
adding endlocaton was the solution!!
Thanks Ross!!

Reply all
Reply to author
Forward
0 new messages