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 / Strange Issue with Off...
Power Apps
Unanswered

Strange Issue with Office365Users Connector and variables

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

Over the past week or so I have been seeing some very strange behavior in a few of my apps with regards to setting some variables and with the Office365Users connector.   It's very bizarre and I can't figure out what is going on.

 

I have a variable, varUser, that is set on App start to Office365Users.MyProfileV2().DisplayName.   This isn't a new addition, it's been there since the app was created and has been working fine.   Once it's set it's used as a comparison to set another value.

 

It has stopped working properly even though nothing has changed.   It appears to work on AppStart but if I set a label to varUser it's blank.  If I hover it, it tells me that the variable is blank.    If I use a button to set it to Office365Users.MyProfileV2().DisplayName, you can see that it does briefly as the name it sets it to flashes in the label and then goes away.   Setting a different variable works fine, so I suspect it may have gotten corrupted.  Not sure why or how though.

 

The other strange issue is trying to get any value from Office365Users.UserProfileV2().     When I enter an email address into it, it tells me that it's an invalid use of '.'

 

o365UserError1.png

 

o365UserError2.png

 

 

 

Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Why not just use the DisplayName property on User()?  it should be the same thing as the one in the Profile and doesn't require a connector.  

  • zmorek Profile Picture
    3,272 on at

    Does the email address need to be in quotes? "user@email.com" ?

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Because it's not always the same.   This is per Microsoft

     

    The information returned is for the current Power Apps user. It will match the "Account" information that is displayed in the Power Apps players and studio, which can be found outside of any authored apps. This may not match the current user's information in Office 365 or other services.

     

    There are places in the app where we need to get the information about another user and you can't do that with the User() function.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    You would think it was a Monday here.    That did resolve that issue.    Thank you.  Now to figure out the other issue.   As I said I think the variable is corrupted, it's the only thing I can think of.

     

  • zmorek Profile Picture
    3,272 on at

    @JR-BejeweledOne thanks! Glad I can help at least a little bit.

     

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    I think that would only be for external users, if you shared with them.  Otherwise it has always shown me what is in Azure AD for internal users, which is always the same as the Profile as far as I know.  The problem is that the profile won't work for external users either, because external users by definition don't have profiles.  Is the comment from Microsoft in the documentation or did someone tell you that?  Would love to see a reference if you have it.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    It's in the very first note of MS documentation for the function.   We won't have external users using this app, so that's not a concern.   You might also note the information about User().email.   It doesn't return what you may think it does.

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-user

  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    Rereading that quote the only way I can see it having something different than the O365 information is if the user has purchased a license based on a Microsoft Account.  Otherwise they are logged in to the player or studio using their O365 account.  Also, I was aware that Email was the UPN, which usually but not always matches the SMTP email.  But normally its the UPN you need.  I would still recommend using the User().DisplayName rather than making a call to the Profile.  As I said, in the instances where the Display Name would be different the user's won't have a profile anyway.  But in most cases it should be the same.

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    So the other reason to not use the User() function is because in our environment full name is FirstName, LastName and displayName is LastName, FirstName, so the User() function won't match what is in a person column in SharePoint.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard