Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

>>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
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

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

HI @Anonymous ,

>>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
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.