Filtering Disabled Users


#1

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:

[color=#FF0000]return itemData[“Title”] != “”;
return true;

or

return itemData[“Title”] != null;
return true;
[/color]

Any assistance would be great.


#2

Hello,

Thank you for your question.

We use JavaScript based syntax for filtration function. So, you can use such filtration function:

function(itemData){ return itemDate["SPS-JobTitle"] || itemDate["Title"]; }

Such expression ensures that at least one of specified properties is not empty.

I checked two properties “SPS-JobTitle” and “Title” because they both can store information about job title in user profile.

Best regards
Anton Khritonenkov


#3

You had a typo in the example you provided, but after correcting, it worked as designed. Thanks for the help.

function(itemData){
return [color=#FF0000]itemDate[/color][“SPS-JobTitle”] || [color=#FF0000]itemDate[/color][“Title”];
}

should be:

function(itemData){
return [color=#008000]itemData[/color][“SPS-JobTitle”] ||[color=#008000] itemData[/color][“Title”];
}


#4

Hello,

Thank you for correction.

Best regards
Anton Khritonenkov
Plumsail Team


#5

Is there a way that you can filter out disable users by their account status being disabled?


#6

Hi Turtlgal,

You have two options to hide disabled users from the chart:

  1. You may set a user to have no manager, here you will find how to do it.

  2. 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:

function(itemData){
   return itemData["Department"] != "Off company";
}

#7

Anna,
I have users with no managers that show up when I do a search. Any ideas?


#8

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?


#9

Hi @turtlgal,

If you applied filtration function on Filtration step of the configuration wizard, it works for whole Org Chart including search results.

If you still see those employees, there are two possible reasons:


#10

Anton,
Im not sure what to put in to the Filtration step to make it where Manager is not empty.


#11

Can anyone help me with what filtration I would use for Manager is not empty? @Anna @antonkhrit


#12

Hi @turtlgal,

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:

  1. Set Root ID to make sure your root employee (probably CEO) is not omitted.
  2. 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;
  
}

#13

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?


#14

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.


#15

@antonkhrit
That worked! thank you. and Im using 3.1.3


#16

Hi Anna,
Where is this javascript file so, I can add these javascript functions.

Thanks!


#17

Hi, indirimkodu

You need to add this script on the “Filtration” step of the configuration wizard.