I am trying to create a user from Google Forms and via App Script, the account will be provisioned in GSuite. When running the script, the account gets created but the employee and organization details are not included in the user account details.
var user = {
primaryEmail: preferredEmail,
name: {
givenName: firstName,
familyName: lastName,
fullName: firstName + ' ' + lastName,
},
relations: {
value: reportingManager,
type: 'Manager',
},
organizations: {
title: designation,
primary: true,
department: dept,
description: employmentType,
costCenter: location,
},
password: password,
changePasswordAtNextLogin: 'true',
};
user = AdminDirectory.Users.insert(user);
Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);