cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vishal1
Microsoft
Microsoft

Graph API or Kusto

HI All,

 

Does anyone has created or called MS GRAPH API via PowerApps, I would like to retrieve user alias, email address, display name, Manager, Skip level, etc.

 

12 REPLIES 12
StalinPonnusamy
Super User
Super User

Hi @Vishal1 

 

PowerApps does not have a connector to Microsoft Graph, so we need to create a custom connector to access Azure AD and calls that API to get AD details.

 

User Microsoft Graph explorer to test Graph API. Here are the few API Calls which help to create Custom Connector. 

https://developer.microsoft.com/en-us/graph/graph-explorer

StalinPonnusamy_0-1636205546921.png

 

To Get Current User Details

https://graph.microsoft.com/v1.0/me

 

Get Specific details about the current user

https://graph.microsoft.com/v1.0/me?$select=displayName,employeeid,userPrincipalName,mail

 

To Get manager 

https://graph.microsoft.com/v1.0/me/manager

 

Get User by Employee ID

https://graph.microsoft.com/v1.0/users?$select=displayName,employeeid,userPrincipalName&$filter=employeeId eq 'sp0108'

 

I found this blog has details above the custom connector for Graph API.


Thanks,
Stalin - Learn To Illuminate

Thanks Stalin, I am aware of custom connector, I wonder if someone has already implemented the same and what is the best way to combine into a single query for user alias, email address, display name, Manager, Skip level

StalinPonnusamy
Super User
Super User

Hi @Vishal1 

 

We can combine the attributes like below

 

https://graph.microsoft.com/v1.0/me?$expand=manager($levels=1;$select=displayName,employeeid,userPrincipalName,mail,mailNickname)&$select=displayName,employeeid,userPrincipalName,mail,mailNickname&$count=true

 

StalinPonnusamy_0-1636333356345.png

 

Not sure about skip level.


Thanks,
Stalin - Learn To Illuminate

Stalin, thank you, can you try to get me employee status as well and skip level is nothing but my manager boss info.

Hi @Vishal1 

 

We can get employees account status

 

https://graph.microsoft.com/v1.0/me?$expand=manager($levels=1;$select=displayName,employeeid,userPrincipalName,mail,mailNickname,AccountEnabled)&$select=displayName,employeeid,userPrincipalName,mail,mailNickname,AccountEnabled&$count=true

 

 
Thanks,
Stalin - Learn To Illuminate

Thank you again, I see you have added account enabled? i wonder if we have column like employee status or employee active or not? and also, how to get manager next level (boss).

Hi @Vishal1 

 

Graph API V1.0 does not have status. Here is the to get manager hiereachy

 

https://graph.microsoft.com/v1.0/me?$expand=manager($levels=max;$select=id,displayName)&$select=displayName,employeeid,userPrincipalName,mail,mailNickname,AccountEnabled&$count=true

 

StalinPonnusamy_0-1636419536737.png

 

Bete version has more properties compared to V 1.0

https://graph.microsoft.com/beta/me


Thanks,
Stalin - Learn To Illuminate

the screenshot you have attached, looks like I don't have access to get manager hierarchy may be due to vendor? and not sure on the beta version. 

StalinPonnusamy
Super User
Super User

Hi @Vishal1 

 

https://docs.microsoft.com/en-us/graph/api/user-list-manager?view=graph-rest-1.0&tabs=http#code-try-...

 

StalinPonnusamy_0-1636429179058.png

 

The Beta version is not for production. MS exploring and can break anything and not guaranteed. For now, we can explore as POC and expect this in the future release.

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,023)