cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndrewCarter
Level 8

userProfile Variable

Just a heads up if you find yourself in a similar position.

I have a global variable called userProfile which is set on APP start to the current user,

 

Set(userProfile, Office365Users.MyProfile())

 

If the current user is an APP owner, then they can switch to debug mode and select the current user, I do this on clicking the users image.

If(_IsAdmin, Set(userProfile, {});
Set(_Debug, !_Debug);
If( _Debug, 
Set(userProfile, Office365Users.UserProfileV2("selected user email")),
Set(userProfile, Office365Users.MyProfileV2())
);
Select(icoRefresh))

 

However, when you then look at the variable you will notice a really odd thing which becomes very annoying.. The properties of the variable are duplicated and then dropped to lowercase, and the initial properties are blank and ProperCase..

This means all your lookups and filter fail, as the are looking at the wrong case I.E userProfile.Mail becomes userProfile.mail etc...

This is because the two versions of the MyProfile(), UserProfile() and MyProfileV2() and UserProfileV2() provide different cases on the properties.

This is probably intentional but it is easy to miss

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 38 members 3,965 guests
Please welcome our newest community members: