You are viewing limited content. For full access, please sign in.

Question

Question

Creating a PDF image from a Forms HTML Field

asked on June 25, 2015 Show version history

Hello,

We have a customer that would like to use the HTML field as a template where data entered from the form fields get populated into the HTML field area.  I realize this can happen on the initial submission, but would like it to happen further down the business process.  Something like this:

 

Dear <name>

We received your inquiry on <inquiry_date> we appreciate your business and will have a response to you within 24 hours of <inquiry_time>.  You have submitted your contact information as:

<address>

<email_address>

Thank you for your submission

 

Then the HTML field would be sent to the entity in a PDF attached to an email, or in the body of the email.  Is this possible through forms, or will it need to be saved into the repository, then a workflow created?

The main reason I ask is that upon submittal, the initial form can be created as a PDF.  I'd really like to have this option after an approval in the business process area.  

If this isn't possible, I'd like to submit as a feature request.  It seems like all of the pieces are already there to make this available.  Thanks,

Scott

 

 

  

0 0

Replies

replied on June 25, 2015

Why bother with the PDF? Why not just put that in the body of an email in Workflow?

0 0
replied on June 25, 2015 Show version history

We implemented this for two of our customers. They basically wanted their form fields reformatted into a template that looks more like a personal message. For example, if the user populates the Customer Name, Customer Email and Date fields, the PDF they get shows something like,

Dear Customer Name,

We wanted to let you know that we are scheduled to come on site on <Date>. We will send you another email at <Customer Email> 24 hours before arrival.

Best,

<User Display Name>

Using Workflow to enter these fields into an email wasn't an option because there were also other elements on the form that the customer needed to see (e.g. user submitted photos needed to be embedded on the form), so it HAD to be the PDF.

Long story short, you can do this in a few steps:

  1. Create a second form (call it "Template Form" or something)
  2. Place the variables for the data you need from the original form
  3. Use JavaScript to take the field values and combine them into one string.
  4. Append the string somewhere on the form (perhaps into a Custom HTML field)

 

For example, it might look something like this:

$(document).ready(function() {
    var customerName = $("#Field1").val();
    var inquiryDate = $("#Field2").val();
    var myMessage = "Dear " + customerName + ",<br><br>We received your inquiry on " + inquiryDate +". We appreciate your business and...";

    $("#Field3").append(myMessage);
});

Then you add a Save to Repository activity in your process and save this second form with it, and the resulting PDF should have the message in the format you want. (You may also want to hide the fields you entered into the form as variables so the customer only sees the custom message.)

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.