cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
msyed6
Level: Powered On

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

 

 

 

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

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

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

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

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

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
msyed6
Level: Powered On

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

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

Community Support Team
Community Support Team

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

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

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

msyed6
Level: Powered On

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

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
Level: Powered On

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

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! 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,319)