1

I made a dynamic org-chart app using KineticJS (on HTML Canvas) which is working using a dummy list of user from the parent site of app. Here I get the users, make them an array of javascript objects then use the objects to populate the org chart. A manager field is used to connect the user and find the trees. I don't know whether this is the best approach but it works...

Now I would like to use the SharePoint User Profiles to populate my Org-chart, Could you please help me pointing out how should I get the user info in this case?

thanks in advance

2

It depends on what you use to load data, JavaScript and web services or server side code. If you use JavaScript you can get all employees logins using search REST query like this:

/_api/search/query?querytext='*'&sourceid='B09A7990-05EA-4AF9-81EF-EDFAB16C4E31'&selectproperties='AccountName'&rowlimit=500

By default SharePoint search doesn't crawl Manager field you can add it to mapped properties, then use search to get all employees information. Search is better from the point of view of performance. Post about displaying employees with JavaScript search API could help you to understand.

If you use server side, you also can use server side search query or iterate through employees using UserProfileManager

I can also suggest to use ready 3rd party solution, like Plumsail Organization Chart.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.