Export employees from Org Chart for SharePoint and Microsoft Teams

You may wish to view all members of your Organization in a spreadsheet format. The best way to achieve this is to have an orderly sequential list of members in CSV form usable in MS Excel, LibreOffice Calc, Google Sheets, Numbers for MacOS and similar software.

How to export to CSV

Open a page where with an Org Chart web part. In the up-right corner, there is a settings wheel icon—click it and choose the Export to CSV option.

Export to CSV

You will see the following menu:

Export to CSV menu

You can specify the following to achieve a better result:

  • Start from this person to pick a manager that you want “on top” of the export data. The resulting CSV will contain this manager and all the employees below. If you live this field blank, the root employee you’ve picked up in the Configuration wizard will be selected by default.

Just start typing a name to get a list of suggestions:

Export to CSV
  • Levels to collect to specify how deep you want the data to go down from the selected manager. The resulting CSV will have all the employees for the selected number of levels.

  • CSV delimiter to chose either a semicolon or a comma to use as a separator.

If you wish to export all the members of your organization, just select the maximum number levels. If you don’t know the precise number of levels in your organization, just type in a large number, for example, 1000.

How to export only specific fields to CSV

You can export only specific fields to a CSV file and it’s possible to do using a bit of Javascript.

Specify a custom array of fields in the Custom Javascript section of Org Chart settings that will be used in the export to CSV. Fields with the item’s current level and the subordinate’s count will be included in the result file automatically.

For example,

renderer.config.CsvExportFields = ["ID", "Title", "Office", "JobTitle"];
CSV export fields

Note

If you use User Profiles data source you need to specify the internal names of SharePoint user profile properties in the array; in case of SharePoint list data source specify the internal field names from the SharePoint list.

How to work with the data

Most of the spreadsheed editors will recognize and open the CSV file automatically. You can open the resulting CSV file in any spreadsheet editor, for example, MS Excel.

You will see a list of employees with all the info from the Box template and the Tooltip tamplate plus some additional fields that you might need for analytic purposes:

  • AccountName contains the SharePoint account of the person. If you use a SharePoint list as a Data Source, you will see item ID instead.

  • Manager contains the SharePoint account of the person’s manager. If you use a SharePoint list as a Data Source, you will see the manager’s item ID instead.

  • PochLevelNumber contains the level number of the person starting from the root employee.

  • PochSubordinatesCount contains the number of the person’s subordinates in total.

Export to CSV

For example, you can view and analyse tha Managers / Employees ration in your Organization:

Export to CSV

Or you can visualize your employees per level:

Export to CSV

Find more examples in this article.