cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
miko1
New Member

List users in SharePoint List from MS Graph API

Hello,

I have trouble to get users from Active Directory(Azure) to SharePoint list. Previously I used Search for users (V2), Get user profile (V2) and Get manager (V2) to get this information:
First Name, Last Name, E-mail, Business phone, Job title, Company and Manager

 

But HR requested that they need a couple more fields to be shown, those would be extensionAttribute8 and EmployeeID. I investigated and found out that MS Graph API would be best to solve this problem.

 

I created flow like this:

miko1_0-1654096908545.png

 

And if I submit into HTTP the next URI: https://graph.microsoft.com/beta/users/example@mycompany.com it goes really well and creates a new row into SharePoint List, but without Manager information.

 

But If I want to have everyone from our Azure AD, it creates empty row in SharePoint list. I tried to use next URIs: https://graph.microsoft.com/beta/users?$expand=manager and https://graph.microsoft.com/beta/users


I would like to use https://graph.microsoft.com/beta/users?$expand=manager to get both end user information and manager's displayName.

 

Here is my Parse JSON:

miko1_1-1654097200311.png

{
    "type""object",
    "properties": {
        "id": {
            "type""string"
        },
        "accountEnabled": {
            "type""boolean"
        },
        "businessPhones": {
            "type""array"
        },
        "companyName": {},
        "department": {},
        "employeeId": {},
        "givenName": {},
        "jobTitle": {},
        "mail": {
            "type""string"
        },
        "state": {},
        "surname": {},
        "onPremisesExtensionAttributes": {
            "type""object",
            "properties": {
                "extensionAttribute1": {},
                "extensionAttribute2": {},
                "extensionAttribute3": {},
                "extensionAttribute4": {},
                "extensionAttribute5": {},
                "extensionAttribute6": {},
                "extensionAttribute7": {},
                "extensionAttribute8": {},
                "extensionAttribute9": {},
                "extensionAttribute10": {},
                "extensionAttribute11": {},
                "extensionAttribute12": {},
                "extensionAttribute13": {},
                "extensionAttribute14": {},
                "extensionAttribute15": {}
            }
        },
        "manager": {
            "type""object",
            "properties": {
                "@@odata.type": {
                    "type""string"
                },
                "id": {
                    "type""string"
                },
                "displayName": {
                    "type""string"
                }
            }
        }
    }
}

 

Here is my Select:

miko1_2-1654097260640.png

 

Here is my Create item:

miko1_3-1654097310429.png

 

Any idea how to get this work? Also, would be awesome if I get this to work to know, how I can get filter out Account disabled user and filter only users, who does have companyNames "Company 1", "Company 2" etc?

0 REPLIES 0

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,178)