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 Apps
Answered

Functions

(0) ShareShare
ReportReport
Posted on by 17

I have a form, OnSuccess a flow and a few patch functions are to be completed. Now i want to make sure that the form is closed only after these functions are performed. How can I make sure the form doesn't hide before these fucntions run.?

Categories:
  • WarrenBelz Profile Picture
    156,566 Most Valuable Professional on at

    HI @rahulx81x ,

    I am not sure what you mean by hide - it you put the Navigation at the end of the OnSuccess code, it will execute then. If this is an integrate Form, then the RequestHide() needs to go there.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @rahulx81x ,

     

    You can try the following function:

    Syntax is 

    IfError(
     Submit(Form);
     Patch();
     ,
     Notify("Error Occured", NotificationType.Error, 1000);
     false;
     ,
     Notify("Success", NotificationType.Success, 1000);
     UpdateContext({varShowForm: false});
     true;
    );

     

    Perform your operations you want like SubmitForm or Patch

    Once all actions is successful, then only Form will close

     

    Hope this helps

  • rahulx81x Profile Picture
    17 on at

    this works for patch functions, but if a flow is triggered, How do i ensure that the RequestHide() is executed only after the flow has run.

  • Verified answer
    Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @rahulx81x ,

    Let's say you triggered a flow using the App.

    Then when the flow fails or succeeds, you need to pass the response back to PowerApp.

     

    In your App,

    You can do the following:

    //I have considered passing response as string with output variable as 'FlowResponse'
    
    UpdateContext({
     varFlowOutput: FlowName.run().FlowResponse
    });
    
    If(
     varFlowOutput = "Success",
     //do this
     ,
     //else do this
    );

     

    Hope this helps

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

    @rahulx81x ,

    You did not mention a Flow, but you could have at the end of it Respond to a Power App or flow and set a value to this (the ID will do called idreturn below) then

    UpdateContext(
     {
     varID:
     YourFlowName.Run(
     ParametersHere
     ).idreturn
     }
    );
    If(
     varID > 0,
     RequestHide()
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

#2
Mohsin Ali Profile Picture

Mohsin Ali 356

#3
WarrenBelz Profile Picture

WarrenBelz 232 Most Valuable Professional

Last 30 days Overall leaderboard