Scenario Overview
In this business scenario the company determines which Team you are in based on the Business Unit you are in.
Whenever a User is moved to a new Business Unit, they have to be added to their Team automatically.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this:
- A formula of type Save - Perform Action is created on the User entity
- When the Business Unit changes, the formula is triggered
- The formula removes the User from all current Teams except for their Business Unit
- It will then add the User to a Team depending on what Business Unit they are now in
North52 Decision Suite Steps
The following set of steps outline how to create this formula:We will use two Decision Table sheets to keep things clear
Note: you will need to create four Business Units - BU Eastside, BU Westside, BU Northside, BU Southside - as well as their corresponding Teams- Eastside Team Westside Team, Northside Team, Southside Team
- Create a new formula, setting the following values in the Formula Guide:
- Source Entity set to User
- Set Formula Type to Save - Perform Action
- Select the Decision Table editor
- Change the Name of the formula to Update Remaining Business Days using Custom Calendar
- Click Save
- Make sure the Mode is set to Server Side
- Make sure the Event is set to Create & Update
- Expand the Source & Target section
- For Source Property, select Business Unit
- Expand Deployment Settings
- Set Pipeline Stage to Post-Operation (Asynchronous)
Decision Table Setup
We will set up two Decision Table sheets:
- Right-click on the Decision Table and select Insert > Insert Decision Table
- Rename the first sheet to RemoveTeams
- Double click its name at the bottom of the sheet to rename
- Select the second sheet and rename it to AddUsertoTeams
Decision Table Sheet: RemoveTeams
- Right-click cell A2 and select Delete > Delete Column as we don't have any Conditions for this sheet
- Right-click cell A2 again and select Insert > Insert Inline Calculation
- Leave the Set Name as it is
- Select cell A2
- Go to the Functions tab and search for GetUserTeams
- Shift click the function GetUserTeams to open up its wizard
- For Friendly Name, type List of Teams
- For Input String go to Source tab, expand Source and click on User
- Click Generate
- Select cell B2
- Type Remove Users from All Teams
- Select cell B4
- Copy and paste the following formula:
DoLoop(CountOccurrences(GetVar('List of Teams'), ',')+1, iftrue( Split(GetVar('List of Teams'), ',', DoLoopIndex()) != [systemuser.businessunitidname] , RemoveUsersFromTeam(Split(GetVar('List of Teams'), ',', DoLoopIndex()) , [systemuser.systemuserid]) ) )
- Copy and paste the following formula:
Decision Table Sheet: AddUsertoTeams
- Select cell A2
- Go to Source and search for Business Unit
- Expand Source and click on Business Unit (Name)
- In cell A4, type 'BU Eastside'
- In cell A5, type 'BU Southside'
- In cell A6 type 'BU Westside'
- In cell A7, type 'BU Northside'
- Note that you will need to have created the four Business Units and their corresponding Teams for this to work
- In cell B2, type Add User to Team
- Select cell B4 and go to the Function tab
- Search for and select AddUserstoTeam
- You should now see AddUsersToTeam('teamname', 'users') in cell B4
- Replace 'teamname' with 'Eastside Team'
- Delete 'users' and click on Source tab > Source > Users
- It should now look like AddUsersToTeam('Eastside Team', [systemuser.systemuserid])
- Search for and select AddUserstoTeam
- Repeat cell B4s step for cell B5, B6 and B7, swapping out the Team with its corresponding Business Unit like in the screen capture below
- Click Save when done
Testing
- Open up a User record and change its Business Unit to one of the Business Units mentioned above