web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching Outlook NickN...
Power Apps
Unanswered

Patching Outlook NickName to an Excel File

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have a PowerApp where we are collecting the usage.  Right now it collection UserEmail, LoginDate, and LoginTime.   We wanted to add the UserID which is stored in the Outlook as the Alias (Nickname).   

 

The patch formula works on everything except the "MailNickname".   Does anyone have a work around or suggestion? 

 

Outlook_AliasIssue.png

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    Try Office365Users.MyProfileV2().mailNickname

    Although your formula should work...IF there is a mailNickname in their Office 365 profile.

    You mentioned Outlook - this formula gets the mailNickname from the Office365 profile.  If you are referring to Outlook contacts, that would be something different.

     

    I hope this is helpful.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Could you please share a bit more about the issue within your app?

    Do you mean that the myAliasVariable value could not be saved into your Excel table?

     

    Firstly, please check if the myAliasVariable is populated with proper value within your app. In other words, please check if you have configured a value for the MailNickname property in your Office 365 profile.

     

    In addition, please consider modify your formula as below:

    Patch(
     'YourExcelTable',
     Defaults('YourExcelTable'),
     {
     UserName: Office365Users.MyProfile().MailNickname,
     UserEmail: User().Email,
     LoginDate: Today(),
     LoginTime: Now()
     }
    )

    Or

    Patch(
     'YourExcelTable',
     Defaults('YourExcelTable'),
     {
     UserName: Office365Users.MyProfileV2().mailNickname,
     UserEmail: User().Email,
     LoginDate: Today(),
     LoginTime: Now()
     }
    )

    Please take a try with above formula, then check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-xida-msft , 

     

    I have tried both solutions and neither worked for me.    We tried using the variable because when first trying the "Office365Users.MyProfile().MailNickname" formula it didn't work.    I've tested both the variable & the formula to the left in a label in a random spot on the app and they do show the Nickname data.  

     

    Thanks!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You're not going to need a variable to test this...

    Simply put a Label control on your screen to test and set the Text property to:

    Office365Users.MyProfileV2().mailNickname

     

    What does that show?  It should show the mailNickname.  If not, then there is some other factor (outside of PowerApps) that is a fault.

     

    Try that first and make sure you get results.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes 

     

    Yes, it works, for use the Nickname/alias = Our userIds. We would like to use in an analytics file.

     

      

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    We were able to get it to work by using the value stored in the label. 

     

    Patch(
     'YourExcelTable',
     {
     UserName: Lbl_Nickname.Text,
     UserEmail: User().Email,
     LoginDate: Today(),
     LoginTime: Now()
     }
    )

     

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    HI @Anonymous ,

    Have you solved your problem?

     

    If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard