Introduction

In this article, you will learn how to automatically update departments by organizational units (OUs) in Google Workspace using xFanatical Foresight. In Google Workspace, Organizational Units (OUs) and Departments are used to categorize users, manage access controls, and enforce policies. As organizations grow, manually updating users’ departments based on their OUs can be time-consuming and error-prone.

For example, when a company restructures its departments, it may need to update the department information for a large number of users. Manually updating this data would be inefficient and susceptible to mistakes. With xFanatical Foresight, IT admins can automate the process, ensuring that departments are accurately updated based on the organizational units, improving efficiency and reducing the risk of errors. This guide will show you how to set up automation to seamlessly update departments based on OUs.

Illustration of automating department updates based on organizational units in Google Workspace using xFanatical Foresight.
Illustration of automating department updates based on organizational units in Google Workspace using xFanatical Foresight

Introducing xFanatical Foresight Automation

xFanatical Foresight is a powerful automation platform designed specifically for Google Workspace. It helps administrators efficiently update departments based on organizational units in bulk. This automation saves time, reduces errors, and streamlines user management by ensuring accurate department assignments across the organization.

Automation Setup Instructions

In this section, we guide you through the automation setup in xFanatical Foresight. We have 2 ways to set up automation rules, Set up automation from a template and Set up automation from scratch. After completing the automation rule, verify whether the automation meets your requirements.

Set Up Automation From a Template

Set Up Automation From a Template

Supported plans: xFanatical Foresight Elite plan.

To set up this automation, the admin must first extract a list of users from Google Workspace. Once obtained, the list can be uploaded to the automation rule, enabling efficient updates of departments based on organizational units.


The template is designed with two rules to simplify and streamline the organizational unit update based on departments:

  • Rule 1: This rule exports all the users into a CSV file with the latest user details, including the user’s primary email, first name, last name and organizational unit path.
  • Rule 2: This rule utilizes the edited CSV file from Rule 1 and updates the department information for each user based on their organizational unit path.


Rule 1: Export user’s organizational unit information

  1. Sign into xFanatical Foresight with your Google Admin account. 
  2. Go to the Templates page.
  3. Search Bulk update department information by users’ organizational units and click on it.
    In the Templates search for Bulk update department information by user's organizational units template
  4. In the Templates > Bulk update department information by users’ organizational units page, click Copy Rule 1.
    In the Templates  Bulk update department information by user's organizational units page, click the 'Copy rule 1' button
  5. For the first time use of the template rule, an dialog Action needed will display requesting necessary permissions required to copy the rule. Click Connect with Google and authorize the permissions.
  6. Upon authorization, a dialog titled Copy of export users’ organizational unit information will display.
  7. Click Next. No configurations required.
  8. Click Review.
  9. In the Review screen,
    In the Review page, provide rule name and create export user's organizational unit information rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  10. The rule is created in the Rules page.
    xFanatical Foresight rule graph for exporting user’s organizational unit information
    xFanatical Foresight rule graph for exporting users’ organizational unit information in Google Workspace.

Rule 2: Bulk update department information by users’ organizational units

  1. In the Templates > Bulk update department information by users’ organizational units page, click Copy Rule 2.
    Bulk update department information by user's organizational units page, click the 'Copy rule 2' button
  2. Click Next
  3. Click on If action.
  4. In the Edit actions > If screen,
    Configure If action by adding branch name, conditions and actions.
    1. Rename each branch according to the organizational unit.
    2. In the Add condition field, select Org Unit Path as the field, choose text starts with as the operator, and enter the matching OU path as the value for each branch.
    3. In the Add next action field, select the Update employee department action to update the department according to the OU path for each branch.
  5. Click on Update employee department action.
  6. In the Edit actions > Update employee department screen,
    Select the desired department mapped to the organizational unit for the rule
    1. In the Department field, select the desired department mapped to the organizational unit.
    2. Click Review.
  7. In the Review screen,
    In the Review page, provide rule name and create Bulk update department information by user's organizational units rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  8. The rule is created in the Rules page.
    xFanatical Foresight rule graph illustrating the automated updating of department information based on OU path.
    xFanatical Foresight rule graph illustrating the automated updating of department information based on Organizational Unit  path in Google Workspace.
Set Up Automation From Scratch

Set Up Automation From Scratch

Supported plans: xFanatical Foresight Elite and Professional (Legacy).

Rule 1: Export user’s organizational unit information

  1. Sign into xFanatical Foresight with your Google Admin account. 
  2. Go to the Rules page, and click new rule button button.
  3. In the Select a trigger screen, select Manual Trigger.
    Select the manual trigger for the Export user's organizational unit information rule.
  4. Click Next
  5. In the Select an action screen, select the List users action.
    Select the list users action for the Export user's organizational unit information rule.
  6. In the Edit actions > List users screen,
    Configure list users action for the Export user's organizational unit information rule.
    1. In the Columns field, select Email, first name, last name, org unit path and keep all other fields as default.
    2. Click Review.
  7. In the Review screen,
    In the Review page, provide rule name and create export user's organizational unit information rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  8. Now, click the play button button for the Export user’s organizational unit information rule to execute it and generate a CSV file containing the detailed user information.
    click the  button for the Export user's organizational unit information rule to execute it
  9. Once the rule has been executed, download the CSV file from the logs page of the first rule.
    download the CSV file from the logs page of the first rule

Rule 2: Bulk update department information by user’s organizational units

Next, set up a second rule to streamline the updation of user’s department information based on Organizational unit path.

  1. Click the New Rule The New Rule button in xFanatical Foresight button.
  2. In the Select a trigger screen, select Data Uploaded trigger.
    Select data uploaded trigger for update department information by user's organizational units rule.
  3. In the Edit trigger > Data Uploaded screen,
    click next to create bulk update department information by user's organizational units rule.
    1. Select the CSV file you downloaded in Step 9 of Rule 1 to proceed with updating department information based on organizational unit path.
    2. Click Next.
  4. In the Select an action screen, select the If action.
    Select If action for bulk update department information by user's organizational units rule.
  5. In the Edit actions > If screen,
    Configure If action by adding branch name, conditions and update employee information action.
    1. Rename each branch according to the organizational unit.
    2. In the Add condition field, select Org Unit Path as the field, choose text starts with as the operator, and enter the matching OU path as the value for each branch.
    3. In the Add next action field, select the Update employee department action to update the department according to the OU path for each branch.
      Select update employee information action for bulk update department information by user's organizational units rule
  6. Click on Update employee department action.
  7. In the Edit actions > Update employee department screen,
    Configure update employee information action for bulk update department information by user's organizational units rule.
    1. In the User primary email field, select the Email variable from the Data uploaded trigger.
    2. In the Department field, select the desired department mapped to the organizational unit.
    3. Click Review.
  8. In the Review screen,
    In the Review page, provide rule name and create Bulk update department information by user's organizational units rule.
    1. In Rule name, enter a rule name.
    2. Click Create.
  9. The Automation rule is created.
    xFanatical Foresight rule graph illustrating the automated updating of department information based on OU path.
    xFanatical Foresight rule graph illustrating the automated updating of department information based on OU path in Google Workspace.
Verify Automation

Verify Automation

To ensure that your rule setup automates as expected, it’s essential to conduct a simple test. The following instructions demonstrate how xFanatical Foresight automates the bulk update of departments in Google Workspace based on organizational unit paths.

  1. Go to the Rules page.
  2. First, click the play button button of Export user’s organizational unit information rule to generate a CSV file containing the latest details of all users.
    Execute export user's organizational unit information rule to list the users
  3. Wait until you receive a notification in the top right of xFanatical Foresight. In the notification message, click View log.
    A notification will be triggered and sent upon the execution of the rule, informing users of the action taken.
  4. In the Logs > Log details page, download the CSV file from the Rule history section.
    Download the CSV file from logs details page.
  5. Edit the CSV file downloaded from the Export users’ organizational unit information rule according to the information that needs to be updated.
    Edit the CSV file downloaded from logs details page.
  6. Go back to the Rules page.
  7. Click on the icon and upload downloaded CSV file to the Bulk update department information by users’ organizational units rule.
    Upload the CSV file to bulk update department information by user's organizational units rule.
  8. Wait for the CSV file to be processed and receive a notification in the top right of xFanatical Foresight. In the notification message, click View log.
    A notification will be triggered and sent upon the execution of the rule, informing users of the action taken.
  9. In the Logs > Log details page, the Rule history section explains the automation history and task xFanatical Foresight has automated on behalf of your Google account.
    A detailed log screen, sent upon the execution of the rule, informing users of the action taken.
  10. Sign into your Google Admin Console. and verify that the user’s department has been successfully updated by the automation rule.
    Verify that user's department is updated by the automation rule

Notes

  • Once after the admin uploads the CSV file the automation rule, xFanatical Foresight will begin exporting the users’ list and updating their department information based on the OU path.
  • If all users within sub-organizational units (sub-OUs) are being matched and updated, and the admin intends to target only a specific OU without affecting its sub-OUs, it's recommended to use the text is exactly operator with case-sensitive matching.
  • Each If action can support up to 10 conditional branches. To handle more than 10 OUs, admins can chain multiple If actions by placing an additional If condition in the Fallback branch of the previous one.
  • At each time a rule is executed, you will receive a notification in the app telling you how it has happened to your rules and whether rules were automated successfully or not.
  • The rule execution and CSV processing may take a few minutes to complete as the system processes the file and updates information efficiently.

Conclusion

Automatically updating departments based on organizational units in Google Workspace with xFanatical Foresight simplifies user management, ensuring accurate department assignments without minimal intervention. This automation not only saves time but also reduces the risk of errors, improving efficiency and consistency across the organization. By streamlining the process, IT administrators can focus on more strategic tasks while maintaining a well-organized and policy-compliant user structure.

Try a 14-day free trial with xFanatical Foresight and manage your tasks.


Related Articles

For more article please visit our website: Articles