cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JR-BejeweledOne
Super User
Super User

Strange Issue with Office365Users Connector and variables

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

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
9 REPLIES 9
Pstork1
Dual Super User III
Dual Super User III

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.  



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
zmorek
Super User
Super User

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

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.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

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.

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
zmorek
Super User
Super User

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

 

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

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.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,543)