Filter Org Chart with Multiple Departments

How can you use the Filtration in the Org Chart to show Multiple Departments (using O365)
The filter works for one Department using this
return itemData["Office"] == "Wellington";
How can you add other departments to this statement?
Or what is the statement to remove multiple departments? Any help appreciated

Hi @JulieJ ,
the Filtration syntax is just JavaScript, so you can use the native JS syntax.
For example, to show only users from speciphic departments or offices, you can do:

var departments= ["A", "B", "C", "D"];
return departments.includes(itemData["Office"]);

Thanks, but I don't understand the correlation between var departments and then on the second line you have
Please can you clarify?

Judging from your code in the first message:

return itemData["Office"] == "Wellington";

I assumed that you're filtering for the value of the "Office" field. You said that in your case it was filtering by Department.

IN my code the departments variable is just an array of strings for the office (or department) names. You can name it as you wish.
itemData['Office'] used in the filtering function will hold the value of the 'Office' SharePoint user field.
For each user, the filtering function will check if his or her 'Office' field is included in the 'departments' array.