Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

With() help in Named Formulas

(0) ShareShare
ReportReport
Posted on by 345

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?

  • EpicTriffid Profile Picture
    345 on at
    Re: With() help in Named Formulas

    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.

  • Verified answer
    Scott_Parker Profile Picture
    1,090 on at
    Re: With() help in Named Formulas

    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)
    )

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard