Forum Discussion
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
- AnonymousNot applicable
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
- AnonymousNot 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/td-p/129714
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
- AnonymousNot applicable
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