cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jayeshv Frequent Visitor
Frequent Visitor

power query function that connects to domain graph api and get user name from principalname

Hi

I need help to create a power query function that connects to domain graph api and get user name from principalname.

In our datasource we only have email Ids and need to convert this to user name.

 

Also, I can connect to graph api only using client id and client secret as I am not admin of my tenant. 

 

Please help. Thanks in advance. 

 

 

3 REPLIES 3
Community Support Team
Community Support Team

Re: power query function that connects to domain graph api and get user name from principalname

HI @jayeshv ,

>>I need help to create a power query function that connects to domain graph api and get user name from principalname.

Unfortunately, current you can't use power query to get current principal name without other permissions.

You can refer to following link to know how to get login username in power query:

4 ways to get USERNAME in Power Query

Please understand that this link is provided with no warranties or guarantees of content changes, and confers no rights.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
jayeshv Frequent Visitor
Frequent Visitor

Re: power query function that connects to domain graph api and get user name from principalname

Hi,

 

I'm able to get the username(not of the logged users, if I give any mail id in a column i should get corresponding name) from microsoft graph by modifying the solution - https://community.powerbi.com/t5/Desktop/Power-BI-Desktop-Unable-to-pull-from-OData-feed-using-Token...

 

But I'm hardcoding the client id and client secret in power query function, is there option to get these values as custom parameters while refreshing the dataset to be more secure?

 

Thanks,

Jayesh

Community Support Team
Community Support Team

Re: power query function that connects to domain graph api and get user name from principalname

HI @jayeshv ,

>>But I'm hardcoding the client id and client secret in power query function, is there option to get these values as custom parameters while refreshing the dataset to be more secure?

I'd like to suggest you use organization account or api key to instead hardcode account and password.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 169 members 1,764 guests
Please welcome our newest community members: