We have been trying to figure out the correct syntax, which will enable us to filter out disabled user accounts. We need to keep this accounts active in Active Directory, but do not want them displaying in the Org Chart. We have decided to “blank out” the Title field in the applicable User AD Properties and use this as the field we want the filter to act against. We have used the following syntax without success:
You have two options to hide disabled users from the chart:
You may set a user to have no manager, here you will find how to do it.
You may also hide such employees by creating a department called, fox example “Off company”, putting disabled employees in this department and filtering the department out of the chart like this:
Anna,
The users don’t show in the Org Chart itself, but they do show in searches. Is there anyway I can filter them out of the search, maybe something that filters on Manager is not Null/Empty?
You can hide users without managers from search. But if they have subordinates, they will be still searchable. So, it is difficult to hide subtrees from search. But if you are ok with just hiding employees without manager, here is instruction:
Set Root ID to make sure your root employee (probably CEO) is not omitted.
Add this part to filtration function:
If you have some other exression in filtraion function, you should add isManagerFilled to your existing expression.
function(itemData){
var isManagerFilled = itemData["Manager"];
return isManagerFilled;
}
So I can apply the root id, but when I apply the filtration after that it no longer can see the root ID.
Is there a way to add an except or else statement?
What version of Org Chart do you use? You can see in on the last page of the config wizard. The latest Office 365 version always displays person with root.
Anyway you always can add exclusion of root employee to your condition like this:
function(itemData){
var isManagerFilled = itemData["Manager"];
return isManagerFilled || itemData["AccountName"].contains("ROOT_ACCOUNT_NAME");
}
Replace ROOT_ACCOUNT_NAME with account name of your root employee.
I am using version Version 3.2.2 and tried to use the suggestion for removing disabled users from search after verifying their Manager is empty (has been for some time now) and they still show up when using the search function. I have also cleared the cache within the org chart app. Any other suggestions on how to remove these users from showing up in the search function?
We tested it another time in the last version of Org Chart (3.2.3). It worked fine.
Please, make sure you insert the code into a field on the Filtration step of the configuration wizard and check if you are using correct quotation marks. Using " or ’ is OK, but “ symbol will not work.
function(itemData){
var isManagerFilled = itemData['Manager'];
return isManagerFilled || itemData['AccountName'].contains('ROOT_ACCOUNT_NAME');
}
If it does not help please try to upgrade to the version 3.2.3.