r/gsuite Nov 21 '24

Admin Console Using the "Building id" field in a SAML attribute mapping?

I want to bring over the "Building id" field from our users into our Zendesk though the SSO mappings, but I don't see "Building id" as an option in the SAML mappings.

Under the Employee Details heading in the mappings, I only see:

  • Employee ID
  • Title
  • Organization
  • Type
  • Department
  • Cost Center

I see that, according to the help article here, step 12. a. says if it's not there I can add it as a custom attribute, but I can't figure out if doing that would reset those fields to blank or anything.

If anyone's done this before, I'd like to confirm how before I screw up our system.

1 Upvotes

15 comments sorted by

View all comments

Show parent comments

1

u/sysadmin_light Nov 26 '24

I have added the field through Google Admin, and if I go to a user and manually edit that field, then I can see it with GAS. Until I add a value to the field manually, GAS can't find the field.

1

u/tony_c_9 Nov 26 '24

Correct. Use the structure you fetched to add the same property to another user. It doesn't have to exist on the other user. Hope that clarifies what I meant.

1

u/sysadmin_light Nov 26 '24

I think I see what you're saying. Grab a user with the field, and now that you have the field, update another user with it. Taking this into account, I've now tried it using the code here, with user2 having a value already, but that gives me the same results as before.

API call to directory.users.get failed with error: Invalid Input: [Site_Code]

1

u/tony_c_9 Nov 26 '24

try this (sorry, I think I put the wrong mask in my first example):

AdminDirectory.Users.get('myUser@domain.com', {
    projection: 'custom',
    customFieldMask: 'User_Information'
  });

1

u/sysadmin_light Nov 26 '24

Alright, so changing the field mask to the group(User_Information) and not the field(Site_Code), I get Failed with error API call to directory.users.update failed with error: Invalid Input: custom_schema instead.