cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Cannot send email after Submit

Hi guys,

I have interesting problem. I have 4 forms in 4 screens. Its something like survey when you go throught this 4 pages and ask to question. After every screen I save it with SubmitForm. At the last screen when you click on on icon finish it should save again your procces on this screen and send automaticly emails to some persons(in my datas Name,Supervisor,Project Manager). 

Odeslaný screenshot obrázek

And the problem is that when I click to save and send it will save my data as you can see here 

Odeslaný screenshot obrázek

But sometimes it doesnt send email because suddenly the value NAME(where is value of email) is lost(here in the third picture you can see in Html text that name is not there, this also happens to two others email values - Project Manager and Supervisor) and then I cant send email. But when I go to detail screen(Preview) I can see that it is saved. So I dont understant where is the problem. Can anybody tell me what can be the problem? 

Odeslaný screenshot obrázek

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Cannot send email after Submit

I tried some things out and indeed putting the send email actions in the OnSuccess property before navigating did not the work when you reference the person picklists. There is another way to do this. Instead of referencing the picklist controls you can reference the LastSubmit property of the gallery. Something like this:

Office365.SendEmail(
    EditForm1.LastSubmit.Person1.Email,
    "Email1",
    EditForm1.LastSubmit.ID
);
Office365.SendEmail(
    EditForm1.LastSubmit.Person2.Email,
    "Email2",
    EditForm1.LastSubmit.ID
);
Office365.SendEmail(
    EditForm1.LastSubmit.Person3.Email,
    "Email3",
    EditForm1.LastSubmit.ID
);
Back()

 

Tried it out and worked in all my test cases. 

To be complete I also tried out your scenario several times putting the emailactions before the SubmitForm action. I had one case of a mail that was not send.

 

I you try out using the LastSubmit property, you could also speed things up a bit with the Concurrent function or even simply send one email to all recipients. 

 

Let me know of this works for you.

View solution in original post

7 REPLIES 7
Highlighted

Re: Cannot send email after Submit

As far as I can see you do nothing wrong.
But I would change the order though. Because the submit form could go wrong and than e-mails would have been sent without the data being saved. In that case it is best to add the sent email actions to the OnSucces property of the form before you perform any other function.
Maybe this will even solve your problem.
Highlighted
Anonymous
Not applicable

Re: Cannot send email after Submit

I was trying to change order before but nothing happened. 😕 

Highlighted

Re: Cannot send email after Submit

Have you tried with putting the send email actions in the OnSucces property of the form as I mentioned? Before you navigate away?
Highlighted
Anonymous
Not applicable

Re: Cannot send email after Submit

Yeah, it didnt help 😕

Highlighted

Re: Cannot send email after Submit

I tried some things out and indeed putting the send email actions in the OnSuccess property before navigating did not the work when you reference the person picklists. There is another way to do this. Instead of referencing the picklist controls you can reference the LastSubmit property of the gallery. Something like this:

Office365.SendEmail(
    EditForm1.LastSubmit.Person1.Email,
    "Email1",
    EditForm1.LastSubmit.ID
);
Office365.SendEmail(
    EditForm1.LastSubmit.Person2.Email,
    "Email2",
    EditForm1.LastSubmit.ID
);
Office365.SendEmail(
    EditForm1.LastSubmit.Person3.Email,
    "Email3",
    EditForm1.LastSubmit.ID
);
Back()

 

Tried it out and worked in all my test cases. 

To be complete I also tried out your scenario several times putting the emailactions before the SubmitForm action. I had one case of a mail that was not send.

 

I you try out using the LastSubmit property, you could also speed things up a bit with the Concurrent function or even simply send one email to all recipients. 

 

Let me know of this works for you.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Cannot send email after Submit

Thanks !! I think it works. Sometimes it doesnt send the whole email with all information. But I will try to fix it. But It sends a email so thats good.

Highlighted

Re: Cannot send email after Submit

If you keep having the issue that mails are not send you could also fallback to using Flow for sending the emails. Flow gives you log info about every run. That helps a lot to find out why an email is not send.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (9,981)