Graph Filter for faster loading

When loading the chart, I noticed there are a lot of requests to https://graph.microsoft.com/v1.0/$batch and it looks like it is loading everyone in my org. We have 500 accounts in Microsoft 365 so the org chart load time is a little slow but the specific org chart I am trying to create is for a particular branch that only has 50 users.

Is there a way we can insert a filter to graph to make it load quicker? I

I'm not saying it works this way but something like this

Get-MgUser -Filter "companyName eq 'Test USA' and department eq 'support'" `
	-ConsistencyLevel eventual `
	-CountVariable count`
	-All

I would love it if there was a way to put in my filter along with the start structure from employee when creating the chart. I'm not sure if this would drastically increase load times but it definitely can't hurt.

Hi @demonjrules,

Currently, there is no way to filter Graph API requests, sadly. Developers may consider adding this feature in the future if there’s enough demand.

For your information, Org Chart only queries users within the specified tree. This means it will only load subordinates of the root employee you set in the Filtration tab. Employees not related to this tree are not loaded.

If employees are part of the tree and a filtration rule is set, we handle exclusions on the client side (in the user's browser). Org Chart doesn't load subordinates of those excluded by the rule. Therefore, adding query-based filtration would only slightly improve performance in this scenario.

I understand. My issue, which is probably fairly unique, is that...

  • We have a global company with ~10 different countries (each country is a branch)
  • I want to create a separate org chart for each country
  • We have a global CEO that I am setting to be the "Start structure from employee" because each country has multiple people directly under the global CEO

So there is no one head person in charge of the country. If there was a head of the country, then I would set that person to be the top of the tree and this wouldn't be an issue but instead, I have to set the global CEO at the top of the tree and filter based on Entra attributes and this causes my slow loading time because the CEO is also the manager for many more people in the entire company.

Here is a horrible drawing to also help explain


The red boxes are for country #1 so I am trying to show the Global CEO + all the red boxes. The problem is the global CEO is the root and he also manages people in country 2 (blue box) and country 3 (green box) so all 400 people in the company load and I have to filter on the client side to only show the 50 red employees from country 1.

Again, probably a problem that a lot of people don't have but that is why I was wondering if there was a way to have some higher control over the graph request.

Hi @demonjrules,

Based on your screenshot, the Org Chart will indeed load blue and green boxes at the second level, but it will not go to the third level or beyond, as those will be filtered out. This means the total number of loaded boxes will still be much less than your entire organization.

We will soon be releasing a new version of Org Chart which will feature various performance improvements, so I suggest we wait for its release and see if the overall performance improves on the new version.