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 / App not seeing Manager...
Power Apps
Answered

App not seeing Managers as Managers for User - AD Email issue Upper / lower Case discrepancy

(0) ShareShare
ReportReport
Posted on by 1,154

Hi,

Not sure if I've raised this in another message but have now identified what seems to be the cause of why the PowerApp that uses Office365User connector to establish the Manager and Managers Manager who designated for the use in SAP and AD 

The app relates to our HR department for job role changes, salary increase and other HR processes.
The manager or managers manager have to raise the query for the user who they manage.  If your not then an error message is displayed.

The issue is some managers are gettign this error message even though in SAP / AD they are the manager??
The only discrepancy I could see was in AD the Email field had the email in upper case.  So AAnother@test.com.  Those that didn't have this issue the email was aanother@test.com.  
To test this theory I had the Email, field in AD, amended to be lower case.  And they could access the app with no issues. 
How can I make the app see upper case AD Email as loser case AD emails?

I've tried  

ClarkyPA365_0-1676390591498.png

 and

ClarkyPA365_1-1676391767288.png


But it doesn't change the format??

I'm also trying to get the AD side to default to lower case Emails but I'm not holding my breath for that 😊

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    69,129 Most Valuable Professional on at

    I think you need to use lower(lower()) in your first formula.  You are casting the email you are submitting to Office 365 users to all lower case, but you aren't converting the .mail address of the manager. That's why the format of the output isn't changing.

    Lower(Office365Users.Manager(Lower(EmployeeValue.Selected.Email)).Mail)
  • Chris1968 Profile Picture
    1,154 on at

    Hi @Pstork1 

    Thank you for your response.

    I've used your formula and it does display the Email in lower case.
    I still have the issue of the app not recognising them as the users manager??

    I still believe it is connected to the Email field format in AD.  As I asked for one of the users to have the Email changed to lower case.  They can now access the app.  The AD Administrator is not keen on converting all formats to lower case and thinks the app should handle this.

    ClarkyPA365_0-1676469130333.png

     

    The error message becomes visible under the below conditions

    ClarkyPA365_1-1676469737069.png

     

     I've made the Global Variable _userEmail read lower case from the App, OnStart function

    ClarkyPA365_2-1676469821271.png

     

    Is there anything, anywhere else potentially I've missed??


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

    The system is going to check against Azure AD (AAD), not on-premises AD. The case of the email shouldn't make a difference in my experience.  I would double check that the manager field is getting synced correctly to AAD. Also verify that your emails are the same as your User Principal Names (UPN). They aren't in all organizations and its actually looking up the UPN not the email.

     

    Also, the error message would be there because you are logged in as chpclark but trying to submit as a manager.  That isn't because you can't retrieve who the manger is.  Its because Power Apps doesn't support security impersonation.  You can't submit something as a manager when you aren't that manager.

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    This is where I'm a bit at a loss??

    When looking previously I noticed that not all the formats of the emails where the same (UPN, Email, and On-Premises user Principal name.

    When comparing the users who could access the app to those that couldn't the Email field was the common dominator in this. 

    So if the On premises user principal name field format isn't the same as the Email field format could this cause confusion?? 

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    Another user who as had the Email field changed from upper to lower can now access the app.

    Looking at their Azure account all fields with email are all lower case.

    Should these, as best practise, be the same format (Upper or Lower)
    Getting confused now on how I can make the app accept these irrespective if upper or lower??

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

    If you are talking lower case vs upper case that shouldn't matter for finding the manager.  But the UPN and the email can be completely different values in some organizations. This is particularly true if the org uses multiple email domains.  But if you're org is syncing on-premises AD with AAD, which they should be, then the UPNs should be the same in the cloud or on-premises.

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

    For getting the manager it shouldn't matter what the case is.  But if you are using the manager email in a condition then those are case sensitive.  Can you be more specific about the actual error or problem you are seeing? Where in the app is it causing an issue?  Is it that you aren't finding the manager for the ones with alternate case? or that the manager that isn't all lower case isn't working in your code?

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    It seems that the users whose Email is upper case are getting this error.  If I get those changed to lower case then they can access the app.

    It's at the initial stage of starting a new request

    This is the formula to make the error message display.  

    Datacardvalue8 = Manager
    Datacardcardvalue98 = Manager's Manager

    The names as Mangers 1st and 2nd are the Managers and set in SAP and AAD.  I know the error message shows as I'm not the manager but this is what they are getting also.


     

    ClarkyPA365_0-1676557527981.png


    Here the managers email fields are different formats. 

    If the format for the Email field is changed to lower case does this set the automatically set the UPN to lower case??

    ClarkyPA365_1-1676557918365.png

     

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

    OK, I get it. The problem is that an IF() using an equals is a case sensitive condition. That's why its not working.  What you need to do to fix it is put the Datacardvalue8.txt entries in the IF inside a tolower() function.  That should take care of the problem.  I would suggest using toLower() when you create the _useremail variable too.

  • Chris1968 Profile Picture
    1,154 on at

    Hi,

    I think I've tried that?

    One of the formulas that have been // uses the lower function

    This is the Global variable which in the App - OnStart.

    ClarkyPA365_0-1676560306527.png

     


    So would it be
    Set (
    _useremail, 
    Lower(User().FullName

    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard