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 / If Powerapps Windows i...
Power Apps
Answered

If Powerapps Windows is closed does still Send button triggers an email

(0) ShareShare
ReportReport
Posted on by 10

 

 

 

Hi All,

 

I have one of the craziest requirement right now. On a Form we are getting the data from Gallery and by flow we are executing a  stored procedure  and updates back to table  and flow is also sending the email. when Send button is pressed it triggers the Email. I am receiving the email but if  some user's clicks on send button and the immediately they close the PowerApp Window.

 It is not sending an email . Is there anyway to let powerapp  know that even if the window is closed or once the send button is pressed even if the powerapps window is closed it should still send an email.

Please Help me on this any inputs can help me.

 

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @msyed6,

     

    Could you please share more details about the OnSelect property of the button?

    If Multiple formula has been configured, then please consider take use of the concurrent function to see if this would solve the issue you mentioned.

     

    Further, currently there is no property or function available to control how the App behaves when closing it, there is an idea submitted on this, please see:

    Application Close Event

     

    Please consider vote it up if that alos meet your requirements.

     

    Regards,

    Michael

  • msyed6 Profile Picture
    10 on at

    Hi Micheal.

     

    The Onselect property of the submit button is saving the Submit form and defining what is the current state of the email. And running a flow, I need to make sure once they hit the submit button even if they close the application window powerapps should send the email as the send button is already pressed for that. 

     

    Here is the Onselect formula of Submit. SubmitForm(CorrespondenceForm); If(CorrespondenceForm.ErrorKind = ErrorKind.None, UpdateIf('[dbo].[TableName]', Id = CorrespondenceForm.LastSubmit.Id, {Status:"Sending"}); UpdateContext({BpeRecord: LookUp('[dbo].[TableName]',VendorId = VendorGallery.Selected.Id && ProjectId = selectedItemId && ProjectSource = projectSource)});Flow.Run(BpeRecord.ToEmails,BpeRecord.Subject,BpeRecord.Body,If(IsBlank(BpeRecord.CcEmails),"",BpeRecord.CcEmails),BpeRecord.Id,selectedItemId,projectSource,VendorId,User().FullName,User().Email);ViewForm(CorrespondenceForm));ResetForm(CorrespondenceForm);UpdateContext({vendorLocked: false, BpeRecord: Blank()});Refresh('[dbo].[TableName]'). 

     

    If you want me to help on this please get in touch with me msyed6@student.govst.edu

  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @msyed6,

     

    SubmitForm(CorrespondenceForm); 
    If(CorrespondenceForm.ErrorKind = ErrorKind.None,
    UpdateIf('[dbo].[TableName]', Id = CorrespondenceForm.LastSubmit.Id, {Status:"Sending"});
    UpdateContext({BpeRecord: LookUp('[dbo].[TableName]',VendorId = VendorGallery.Selected.Id && ProjectId = selectedItemId && ProjectSource = projectSource)});
    Flow.Run(BpeRecord.ToEmails,BpeRecord.Subject,BpeRecord.Body,If(IsBlank(BpeRecord.CcEmails),"",BpeRecord.CcEmails),BpeRecord.Id,selectedItemId,projectSource,VendorId,User().FullName,User().Email);
    ViewForm(CorrespondenceForm));
    ResetForm(CorrespondenceForm);
    UpdateContext({vendorLocked: false, BpeRecord: Blank()});
    Refresh('[dbo].[TableName]')

    For the bold part, would it be possible to put them under the OnSuccess property of the form control?

    For the EditForm

    "

    • If the submission succeeds, the Error property is cleared, the ErrorKind property is set to ErrorKind.None, and the OnSuccess formula runs. If the user created a record (that is, if the form was previously in New mode), the form is switched to Edit mode so that the user can edit the newly created record or a different one.

    "

    As your formula executes based on previous formula result, the App would need to open until the whole command finished, if there are any errors when submitting new records, or the execution was interrupted, the flow will not run as expected.

     

    Regards,

    Michael

  • msyed6 Profile Picture
    10 on at

    Hi Micheal,

     

    Any Suggestions or Tips in adding a URL in a Form. I have a scenario once they select from gallery it will take to another Gallery from there  it will be  selecting(peoples from gallery). Once they press the second gallery option it opens a form to send a email.

    I have some people which are missing some Ids fior them we need to add the URL(for there organization or sharepoint link) for missing people. How can we add the URL for that specific people in within context of the form for only two or three people.

     

     

    Regards

    msyed6

     

     

     

     

  • msyed6 Profile Picture
    10 on at

    Also sorry I forgot to ask this question to you in previous post.

     

    Do u want me to add this whole part of formula in Onsuccessproperty of the form?

    If(CorrespondenceForm.ErrorKind = ErrorKind.None, 
    UpdateIf('[dbo].[TableName]', Id = CorrespondenceForm.LastSubmit.Id, {Status:"Sending"});
    UpdateContext({BpeRecord: LookUp('[dbo].[TableName]',VendorId = VendorGallery.Selected.Id && ProjectId = selectedItemId && ProjectSource = projectSource)});
    Flow.Run(BpeRecord.ToEmails,BpeRecord.Subject,BpeRecord.Body,If(IsBlank(BpeRecord.CcEmails),"",BpeRecord.CcEmails),BpeRecord.Id,selectedItemId,projectSource,VendorId,User().FullName,User().Email);
    ViewForm(CorrespondenceForm)); 

     And in Send button(Onselect): 

    SubmitForm(CorrespondenceForm); 
    ResetForm(CorrespondenceForm);
    UpdateContext({vendorLocked: false, BpeRecord: Blank()});
    Refresh('[dbo].[TableName]')

    And I want make the form reeditable sometimes flow not trigger? 

    Inputs can guide in correct direction.

    Thanks micheal! 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard