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 / Delegation and lookup ...
Power Apps
Answered

Delegation and lookup using User().Email

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

OK, So I seemed to have solved this problem, I'd like to know more about how the lookup function is handling User().email

 

In my application i need one of my global variables to show the user roll. This user roll is determined by a SharePoint list with roughly 10000 rows.

 

To do this i initially did the following:

Delegation 1.jpg

 

 

 

 

 



This is flagging that the User().Email function has a delegation issue (even though it shows 'Data type: text') This should  be able to delegate it, but it wasn't.

So i changed it to:
Delegation 2.jpg

 

 

 






This clears the delegation warning, but still does not retrieve anything beyond the set limit (of 2000)

 

The solution I have found to this is:

Delegation 3.jpg

 

 



 





Setting User().Email as a variable in itself solves the problem.

 

Is anyone able to tell me
A) if this is a good work around
B) what is actually happening with User().Email - is it showing text, but actually is first evaluating a record?

 

Thanks!

Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Anonymous
    User().EMail is not delegable, however a Variable is, so set a Global Variable at App OnStart

    Set(vUser,User().Email)

    Then do 

    Set(Var_User_Role,
     Lookup(
     'User Roles', 
     vUser = User_Profile_Email,
     User_Role
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks @WarrenBelz!

     

    Why does it not allow the delegation of the User().Email in this situation? even though it returns a text value?

  • Verified answer
    WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Hi @Anonymous ,

    You would have to ask Microsoft that one (like a lot of Power Apps anomalies to what we are used to).

    I use the workaround on every app and it works fine.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    First, thanks for your help!

    I've found the reason why my original method didn't work!

     

    The reason User().Email can't be used within this function is that, in this case, we are trying to nest a function that is actually retrieving a record "User().", then filtering to give a text record "User().Email". 

     

    When you do the lookup function it evaluates the user "User()" element first, this produces a record. This cannot be delegated, so it never goes beyond this point

  • WarrenBelz Profile Picture
    156,774 Most Valuable Professional on at

    Ok thanks @Anonymous  - a pleasure.

    PowerApps is always a joy when you are used to SQL . . .

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 337 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 250

#3
Mohsin Ali Profile Picture

Mohsin Ali 225

Last 30 days Overall leaderboard