Filtration Rules Don't Seem To Be Effective

When I add a filtration rule to only include users where Department == “Finance Department” but set the CEO as the RootID, I get an error message saying it can’t find the CEO. But if I leave the RootID and remove the Filtering, the CEO shows up.
How can I start at the top level and find all users where there department contains finance
itemData[“Department”].contains(“Finance”)
or equals “Finance Department”?
return itemData[“Department”]==“Finance Department”

After further testing, it seems like the RootID has to satisfy the filtration criteria. Waiting to hear back from someone else to confirm or correct my assessment.

Hello @DougPunchak,

Looks like the CEO is excluded because he/she doesn’t belong to the finance department. In this case, you would need to add a condition to the filter:

function(itemData){
  return itemData["Department"].contains("Finance") || itemData["AccountName"].contains("ROOT_ACCOUNT_NAME");
}

(“ROOT_ACCOUNT_NAME”) is needed to make sure the Root ID account with no department is not omitted.

You may add more conditions to the filtration rule like this:

|| itemData["FieldName"].contains("FieldValue") // FieldName contains"FieldValue"

or like this

return itemData["FieldName"] == "FieldValue" // FieldName equals "FieldValue"

You may find more information about Filtration in this article.

Best Regards,
Anna Dorokhova
Plumsail Taam

I cannot get filtration rule to work either. A root item ID "3667" configured without filter works. However, when I need to filter where the department = "Service Project Management" I get the error - "Cannot find root item with ID "3667". Please ensure that you specified correct configuration in the configuration wizard.
If I remove the root item ID "3667" - I get this: Unable to automatically find the root item ID. Possibly you specified the filtration rule that excludes everyone who could be automatically detected as a root item. Please specify root item ID manually in the configuration wizard (Filtration step). When I use this filtration:
return itemData["Department"] == "Service - Project Management" || itemData["RootID"].contains("3667"); same message.

Hello, @tbrummett

  1. Are there any intermediate links between the root and filtered elements that can be excluded by your filtration rule? Please take a screenshot of the chart and mark the element that should be the root one and those to be filtered.

  2. In the filtration rule, you can use only existing fields of the data source and there is no such a field "RootID" though you can find it in the Wizard. To configure the rule, please check available fields.


  3. So your rule should look like:
    return itemData["Department"] == "Service - Project Management" || itemData["ID"] == 3667;

  4. Make sure that there are no mistakes in the department name.

  5. Please take also a screenshot of the "Filtration" section of the Wizard.

I think what I was expecting was to get Carlos and Dina on the same chart.

HelpForFiltering.docx (114.0 KB)

It seems that for the chart, the department is whether "Service Division" or "Houston - Airport." To make sure, please provide me with screenshots of a "Data source settings" section of the Org Chart Configuration Wizard and of column names with at least one visible item on your source list so I could correlate values and names of item properties.

HelpForFiltering2.docx (96.4 KB)

Please find Pat Schiele on the list and copy his ID from the accordant column (not from the "RootID" one). Then empty the "Filtration rule" and "Root ID" fields and paste the following code in the "Filtration rule":

function(itemData){
  return itemData["Department"].contains("Service - Project Management") || itemData["ID"] == 1;
}

Replace 1 by the Pat's ID from the ID column.

No go.

HelpForFiltering3.docx (93.7 KB)

The last try to find out what is going on. If it doesn't help, I will pass the case to developers.

Please share all field names that are available for the chart. Maybe the names of columns on which the rule is based differ from their internal names that Org Chart uses to filter data. Could you click field names and take a screenshot of available fields, then scroll down to see the rest of them and take another one?


Sounds like a plan. HelpForFiltering4.pdf (57.1 KB)

Please try the following rule again, but in this case, define the value in the "Root ID" field too.

function(itemData){
  return itemData["Department"].contains("Service - Project Management") || itemData["ID"] == 3667;
}

Outstanding! I can't tell you how happy this makes me! :smile:
I appreciate your patience and efforts so much.

I can't wait until we solve the picture printing issue. But I'll leave that for another thread. :grin:

1 Like