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 / How to fit in another ...
Power Apps
Answered

How to fit in another function in this formula

(0) ShareShare
ReportReport
Posted on by 67

I need this specific button to close down a window on top of doing everything else that its doing. The problem is I can't fit in the UpdateContext function that I need for it to close such window. 

 

Here's the code:

 

With(
 {lclTime: TimeValue(ddAdjustHour.Selected.Value & ":" & ddAdjustMinute.Selected.Value)};
 UpdateIf(
 'Time Tracker';
 ID = lclCorrection.ID;
 {
 ActivityDateTime: lclTime;
 ActivityDate: Now()
 }
 )
) 

And here's what I need to fit in:

 

UpdateContext({lclCorrection:Blank()})

 

I've seen it say that it expects an operator, but then if I use "&&" it breaks the rest of the code saying it expects a valid argument (boolean, number, text, OptionSetValue). Depending on where I insert it, it says it can't be used inside the With function. Any ideas?

Categories:
  • Gerard Simpson Profile Picture
    2,987 Moderator on at

    Hi @vinidegrandi 

     

    Is there any reason why it cannot go outside, after the with statement?

     

    With(
     {lclTime: TimeValue(ddAdjustHour.Selected.Value & ":" & ddAdjustMinute.Selected.Value)};
     UpdateIf(
     'Time Tracker';
     ID = lclCorrection.ID;
     {
     ActivityDateTime: lclTime;
     ActivityDate: Now()
     }
     )
    );UpdateContext({lclCorrection:Blank()})
     

     

  • vinidegrandi Profile Picture
    67 on at

    It says the last semicolon is an unexpected character. If I take it out it says it expects an operator...

  • Verified answer
    iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at
    With(
     {lclTime: TimeValue(ddAdjustHour.Selected.Value & ":" & ddAdjustMinute.Selected.Value)};
     UpdateIf(
     'Time Tracker';
     ID = lclCorrection.ID;
     {
     ActivityDateTime: lclTime;
     ActivityDate: Now()
     }
     );;
     UpdateContext({lclCorrection:Blank()})
    ) 

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 330

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard