Filter domain in Org Chart

Hi,

Is there a way to filter the Org Chart so it only displays users from 1 domain?

We have several domains in our company. I'm aware you can filter using the Department field and we currently have a filter for specific Departments but wondered if we could also filter to a specific domain. Can we add a line to this current rule to achieve this?

function(itemData){

return itemData["Department"] != "Sales" && itemData["Department"] != "Marketing";
}

Any help would be appreciated, thank you

Hello @aria,

If you use Org Chart for SharePoint Online, you can filter by domain based on the user's account name. Add the following code to the 'Filtration' section of your Org Chart:

Org Chart V4

(itemData) => {
  return itemData["AccountName"].contains('YOURDOMAIN.onmicrosoft.com');
}

Org Chart V3

function(itemData){
  return itemData["AccountName"].contains('YOURDOMAIN.onmicrosoft.com');
}

If you wish to filter by both department and domain, you should modify the condition as follows:

return itemData["Department"] != "Sales" && itemData["Department"] != "Marketing" && itemData["AccountName"].contains('YOURDOMAIN.onmicrosoft.com');

1 Like

Thanks, this is just what we needed!

1 Like