Expand my Community achievements bar.

How do I pull data from a form and populate the default email?

Avatar

Level 1

Hoping someone can help me populate the default email from a submitted form.

I have a student information form developed in LiveCycle Designer ES8.2 that will be distributed. It includes student information and then information on the agency where they will conduct their on the job training. When they click submit, I get an email with the pdf attached. I would also like the email I get to pull some information from the form and populate the default email body with some information so that I can quickly forward that email to the contact where they will do their on the job training.

I want the body of the email to pull from the form the stuff in quotations

Dear "Agency Contact" ("Agency Contact Email")

The student, "First Name" "Last Name" has applied to work at your agency. Please confirm they can work there blah blah blah...........

Thanks.

respectfully,

Me

Hope this makes sense. Thanks for any assistance in how to code this.

3 Replies

Avatar

Level 10

here you can add email to send to, CC, Subject, and body message

var oDoc = event.target;

                    oDoc.mailDoc({

                                                            bUI: false,

                                                            cTo: "Agency Contact Email",

                                                            cCC: "",

                                                            cSubject: "Write your title here,

                                                            cMsg: "Dear" + AgencyContact + "(" + AgencyContactEmail + ")\nThe student, " + FirstName + " " + LastName + " has applied to work at your agency. Please confirm they can work here blah blah blah.......\n\nThanks.\n\nrespectuflly,\n\nme"

                                                  });

Avatar

Level 1

Thank you Magus069. Few questions on your response.

1. It looks like the code you provided would automatically send the form to the "Agency Contact". Is that correct?

     Using the submit button, I have it set to come to me as a pdf attached to an email and that is working fine. What I want to do is have the text in the body of the email message be autopopulated with certain language and pull in a couple of data pieces from information that was filled in on the form. This will allow me to quickly forward an already populated email to someone identified in the form.

2. Can you update your code to show me how to do that?

3. Can you tell me how and where I put this in Livecycle/

Thanks in advance for your assistance and time.

Thanks in advance to anyone else who might have some advice to solve this issue.

Avatar

Level 10

well if you are scripting with javascript in the click_event of a button you can enter this code there...

to autopopulate the body message with some value inserted in the form, if I understand correctly, you must

use the "reference_syntax" of an object and use its rawValue to extract the information from it, then thats how you can use values entered in your form.

"reference_syntax" is defined as a tree to access your object e.g.

you want to access Textfield14 inside Subform12, which is Page1.

xfa.resolveNode("Page1.Subform12.TextField14").rawValue