web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / With() help in Named F...
Power Apps
Answered

With() help in Named Formulas

(0) ShareShare
ReportReport
Posted on by 364

Hi all,

 

So I've just started delving into Named Formulas, and love the performance increases, but I seem to have hit a block with the delegation warnings that come about.

These formulas send back delegation warnings when used elsewhere, which I'm aware is currently a bug:

 

 

 

//User Variables
 currentUserProfile = Office365Users.MyProfile();

//User details variables
 currentUserID = Left(currentUserProfile.UserPrincipalName,8);
 currentUserName = currentUserProfile.DisplayName;
 currentUserEmail = currentUserProfile.UserPrincipalName;

spendCategories =
 Filter('Non-Pay Spend Categories', Number <> 0);

 

 

 

Reading around, it seems I can use With() to get around this, but this is new to me as well and it completely boggles my brain. I have tried this with the user variables, but no dice:

 

 

//User details variables
 currentUserID = With({currentUserProfile: Office365Users.MyProfile()}, Left(currentUserProfile.UserPrincipalName,8));
 currentUserName = With({currentUserProfile: Office365Users.MyProfile()}, currentUserProfile.DisplayName);
 currentUserEmail = With({currentUserProfile: Office365Users.MyProfile()}, currentUserProfile.UserPrincipalName);

 

 

What am I doing wrong here?

Categories:
I have the same question (0)
  • Verified answer
    Scott_Parker Profile Picture
    1,090 on at

    I'm not sure what you've been reading, but I suspect that the With() statement is supposed to be included where you are accessing the Named Formula, not where you are defining the Named Formula. The With() forces the evaluation of the formula and then you use the value later on. Something like

     

    With({_currentUserID: currentUserID},
     Filter('SharePointList', 'UPN' = _currentUserID)
    )

     

  • EpicTriffid Profile Picture
    364 on at

    Ah @Scott_Parker 

     

    Thanks for clarifying that. It appeared as if it would stop the delegation warning when declaring the named formula, but I must have read it wrong. I may just leave it for now until it is fixed.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard