SOLVED

How to get a list of all users in Office365 tenant

Occasional Contributor

I have a custom form inside SharePoint online. I've been asked to create a dropdown with the first name + last name of all users in my Office 365 tenant. 

 

The only way I can think to get that information client side is Microsoft Graph but I'm having a really hard time finding simple examples that show how to use ADAL.js and Graph. All the examples I'm seeing are using Angular, NodeJS, .NET or other platforms when I just want to do simple jQuery ajax calls to Graph and parse the results into an array. 

 

Can someone point me in the right direction 

5 Replies
best response confirmed by Kessy Similien (Occasional Contributor)
Solution

Have you seen this example: http://paulryan.com.au/2015/unified-api-adal/?

Regards

Reading through it now. I love how he says "I failed to find a simple example of how to achieve this, my search results often filled with examples of calling the APIs from server-side code or else utilising the Angular.js framework", that was exactly my experience.
How did you create the form? are you using a SP list? have you seen the Office UI Fabric People Picker, http://dev.office.com/fabric#/components/peoplepicker?
Hey Dean,

The data is stored in a SP List but the form is all HTML. The people picker is great for the UI but I still need to be able to pull all the users in the tenant. Fabric UI won't get the data for you, just present it.