List of people under a department head
The problem
Manually making a list of every person in a department under a department head and then manually maintaining that list can take a lot of time. Fortunately, this is a repetetive task that can be done by computers with a little bit of coding.
Below we will describe the general steps that could be done regardless of which language or tool set you decide to use. Going through the general steps helps us to organize our work and then decide which languages or tools would be best to use.
We will assume for this scenario that your department has one single person into whom all people in the department report.
Next you will need to have some kind of data source that contains the org chart structure of everyone under your department head. Two main sources that I analyzed in my own situation were the Outlook address book for my company and our WorkDay account.
In my own situation, I found that Outlook has all the email accounts of everyone under the department head. But it also has every group email account that was ever created. These are email accounts not representing an individual, but a team, like "legal@company.com". These accounts are set up in Outlook to technically report into a manager.
I also had the problem that there were a lot of old email accounts of people who had left the company years ago, but their accounts were still active in Outlook and they were linked to a manager.
Then I looked at WorkDay. My company decided to only make WorkDay accounts for full-time employees. So no part-time employees are listed in WorkDay. No contractors, temporary employees, or interns. If we really wanted to make a list of every member of the department, WorkDay would not be useful. I would like to note, that I did find that WorkDay does have an
API (application programming interface) so it would be possible to get data out of WorkDay in an automated way. In my case, my company refused to grant me API access. They told me I can only access org charts in WorkDay manually.
So however works for you, you will need to have access to a data source of your existing department members. You may find that you will need to go through a cleaning effort to remove the old accounts or to mark the group accounts that don't belong to individuals.
Once you have your department head and your data source, the next steps are fairly straight forward. You will need to start a list of all members of your department. I also like to keep a tally of the employees that are left to analyze. Put the email address of the department head on that list to start with. Start your tally at 1. Then start at your department head and get the list of their direct reports and add their email addresses to the list. Subtract 1 from your tally because you just analyzed your department head, but add the number of their direct reports to the tally. Then just like you did with the department head, loop through each of them and get all their direct reports and do the same thing, adding the names of those direct reports to the list and adding their number to the tally of employees left to be analyzed.
When you are all done, you will have a list of the email addresses of everyone in your department. The tally of employees left to analyze will be exactly zero. You should save this list of email addresses in a convenient place.
The benefits of having this list
Some things you can do with this list. It's a convenient way to have a current list when you want to send an email to everyone in the department. There may be a folder on your company intranet that you want visible only to members of your department. Instead of waiting and forcing new joiners to manually request access, instead when a visitor tries to access your folder, you compare their email address to the list and if they are on the current list, then you show them the contents of the folder. You could also compare this week's list with last week's list. This will show you the people who joined in the last week and those who left. For new people who joined, you can send them an automated email to welcome them and offer them onboarding resources. You could connect to more automations to automatically provision them with new accounts in other systems. And going the other way, you can automatically close down accounts and access for people who left the department.
The possibilities are endless. So how would you do this using the languages and tools available to you?
Related
A related scenario, is how to make an
org chart of everyone in your department that automatically updates each week. It's basically the same kind of loop, but instead of making a flat list, you would need to preserve the link of who the employee's manager is.
Solutions to this scenario