Getting started
Configuration wizard
HTML templates
JavaScript framework
Additional resources
- Video: Introducing Plumsail Org Chart
- Data caching
- SharePoint Server 2019/SE (On-Premises) resources
- Installation for SharePoint 2019 / SE
- Quick configuration
- How to add Org Chart to Microsoft Teams tabs
- Generate organization structure report
- Layout
- Filtration
- JavaScript custom code
- General settings
- Display assistants
- Display dotted-line managers for Org Chart
- Display vacancies
- Customize box HTML template and CSS styles
- HTML templating syntax
- Change Org Chart skin
- Create org chart with two root managers
- Order employees boxes using custom field
- How Org Chart pulls data from AD On-Premises
- Drill down to current user by default
- Drill down to specific box using URL parameter
- Include and use fields from additional list
- Use advanced Org Chart navigation
- How to open Org Chart in full-screen mode on load
- Support of search in a list with more than 5000 items
- Exclude disabled users in On-Premises
- Configuring profiles sync in On-Premises
- Make sure that SharePoint has enough data
- Exporting properties to a directory service
General
- Version history
- Licensing details
- Data protection and security
- Custom code security measures
- Billing and subscription management
Printing & Reports
- Printing organizational structure
- Generate multi-page PDF report
- Export to CSV and analyze in Excel
- Custom styles for printed Org Chart
Microsoft Teams
Display different types of employees
Filter and order boxes
- Create and manage filtered views
- Order employees boxes using a custom field
- Group employees boxes using a custom field
Customize boxes and styles
- Format boxes conditionally
- Customize box HTML template and CSS styles
- Display awards and conditionally format Org Chart
- Create an Org Chart with two root managers
- Change Org Chart theme
- Localize Org Chart
Show specific user on load
- Drill down to specific box using URL parameter
- Drill down to current user by default
- Drill down to manager of user from URL by default
Manage web part size and scale
- Open Org Chart in full-screen mode on load
- Make Org Chart use full page width
- Automatically scale boxes to fit visible area
Other examples
- How to customize Org Chart
- How to use advanced Org Chart navigation
- Use tenant properties to disable Org Chart features
- Include and use fields from additional list in Org Chart
- Support of search in a list with more than 5000 items for Org Chart
- Show Org Chart based on a list data source for anonymous users
- How to check if a user has Tenant Administrator permissions
Drill down to current user by default in Org Chart (SharePoint Server 2019/SE)
In this tip I want to cover such case as drilling down to current user by default on Org Chart load. We see such questions frequently and decided to cover it in our blog.
Org Chart supports two data sources: User Profiles and SharePoint list. I will show how to implement drill down to current user for both.
Drill down to current user on Org Chart load for User Profiles
It is quite simple to implement such drill down for User Profiles data source using JavaScript framework. Just open the configuration wizard and paste the code below to JavaScript editor on Custom JavaScript step.
renderer.config.renderInitialNode = false;
renderer.onInitialLoadingFinished(function () {
renderer.dataProvider.getCurrentUserAccountName(function (accountName) {
renderer.drillDown(accountName);
});
});
See the screenshot below for example:
Drill down to current user on Org Chart load for SharePoint list
It is more difficult to implement such behavior for SharePoint list.
First of all we have to ensure that we have field with account name of user in our SharePoint list.
In my case I created list field called “AccountName”.
Then I used JSOM to find list item by account name of current user.
I used CAML query to do this.
Once I have list item for current user I can read ID of for this item and drill down to it using JavaScript framework.
Actually you can just copy and paste the code below to JavaScript editor on Custom JavaScript step of the configuration wizard.
The only thing you may need to replace is internal name of field where account name of user is stored in SharePoint list.
Just replace AccountName with your field internal name:
var loginFieldInternalName = "AccountName";
And it is complete script to copy paste:
function getCurrentUserOrgChartId(completed, error) {
var camlQueryTemplate = "<View><Query><Where><Eq><FieldRef Name='{{loginFieldInternalName}}'/><Value Type='Text'>{{currentUserLogin}}</Value></Eq></Where></Query></View>";
var listId = renderer.config.ListDataSourceSettings.ListId;
var orgChartIdFieldName = renderer.config.idFieldMapping.InternalFieldName;
var context = SP.ClientContext.get_current();
renderer.dataProvider.getCurrentUserAccountName(function (currentUserLogin) {
console.log("currentUserLogin:", currentUserLogin);
currentUserLogin = currentUserLogin.replace(/.*\|/, "");
var list = context.get_web().get_lists().getById(listId);
var camlQuery = new SP.CamlQuery();
var queryText = camlQueryTemplate
.replace("{{loginFieldInternalName}}", loginFieldInternalName)
.replace("{{currentUserLogin}}", currentUserLogin);
console.log("queryText: ", queryText);
camlQuery.set_viewXml(queryText);
var foundItems = list.getItems(camlQuery);
context.load(foundItems);
context.executeQueryAsync(function () {
f = foundItems;
var en = foundItems.getEnumerator();
if (en.moveNext()) {
var fieldValuesForCurrentUser = en.get_current().get_fieldValues();
var currentUserOrgChartId = fieldValuesForCurrentUser[orgChartIdFieldName];
completed(currentUserOrgChartId);
} else {
console.log("List item for current user not found.");
}
}, function (sender, args) {
error(args);
});
});
}
var currentUserId = "";
var loginFieldInternalName = "AccountName";
renderer.prerenderAction = function (completed) {
getCurrentUserOrgChartId(function (userId) {
currentUserId = userId;
completed();
}, function (errorArgs) {
console.log(errorArgs);
completed();
});
}
renderer.onInitialLoadingFinished(
function () {
if (currentUserId) {
renderer.drillDown(currentUserId);
}
}
);