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

Retrieve the samacccountname for a give userid

Dear all

is it possible to retrieve the samaccountname for a given userid using OOTB PowerApps Connectors? When checking the Office365Users or AzureAD Connectors, I do not see samaccountname. The closest is UserPrincipalName which is not what I need.

 

Thanks

Andrew.

4 REPLIES 4
ganeshsanap
Memorable Member
Memorable Member

@agaskelluk 

 

Office 365 User connector does support fetching onPremisesSamAccountName using Get user profile (V2) method.

 

This method returns the properties mentioned at: user resource type - Properties 

 

If this is not working for you then see related workaround (using Power Automate or Graph APIs):

  1. How to populate a SharePoint Online List column with AD User Attributes? 
  2. sAMAccountName attribute in Azure AD 

Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

Hi @ganeshsanap 

I don't see the onPremisesSamAccountName property for UserProfileV2 when I try to call it in my powerapp:

Office365Users.UserProfileV2("test@xyz.com").XXX

 

Perhaps I am doing something wrong. Can you advise?

 

Thanks

Andrew

 

ganeshsanap
Memorable Member
Memorable Member

@agaskelluk 

 

Not sure why but here's what described in documentation: 

 

Power apps - office365 users properties.png

 If this is not working then you can try using MS Graph or Power Automate approach.


Please click Accept as solution & ‌‌👍 if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

agaskelluk
Frequent Visitor

Yes I saw that method listed in the documentation but I cannot access it from intellisense in PowerApps.

Thanks.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (1,736)