Looking for information about ProntoForms features and functionality? Visit our Product Documentation Portal.
Create custom documents in any format to pull data from your submitted forms. Using ProntoForms' Data Record Expression Language (DREL), you can build a document to display information in easy-to-read formats. This could be used to generate a custom XML format or a custom HTML invoice, for example.
DREL is a ProntoForms-specific language that is used to reference data in submitted forms (data records). It can be used to build a string using properties from form submissions, including answers. Read here for full details of the properties that DREL can reference.
A number of other document types are available, and multiple documents can be sent with a single form submission. Read more about documents here.
Create the document, select DREL as the document type, then follow the instructions below.
Give the document a unique name. Optionally provide a description.
This name applies to all instances of the document, including downloaded documents and documents sent by Data Destinations.
- Use Data Record Expression Language to reference answers in your forms.
- Static text can also be included.
- For example, %r -- %a[Customer Name] would name the file like "20140812-180001002 -- John Smith."
You download files from multiple form submissions so that you can work locally.
You or your customers receive multiple messages generated by Email Destinations.
- Some data destinations will overwrite files with duplicate names. Make sure file names are unique by including one or more of:
- %r - the submission's reference number -- e.g. 20140920-1815562464
- %r[id] - the submission's ID - e.g. 1815562464
- %t - the time the form was submitted
Choose a document time zone source. This is the time zone for all dates and times in your document.
- Team Preference Setting: Will use the time zone chosen for the team
- Data Record: Will use the time zone the form submission is made from (as chosen on the mobile device).
- Custom: Choose a time zone.
Selecting this option will add the document as an "Additional Document" to forms created or imported after this option is set. Submissions made against these forms will be downloadable in this document format from the "Data" tab of the portal.
The document can be any text-based file type (HTML, .txt. .xml, etc).
Leave this blank for automatic resolution based on file extension.
Paste your DREL Template (whether hand-written or created through a WYSIWYG editor) into the text box. You can use a combination of static text and Data Record Expression Language. Line breaks will be preserved.
Info:We recommend that you escape the data for all JSON, XML, HTML, and CSV documents. This ensures that the system generates a valid document in your selected format.
Display your data in a user-friendly way by creating a custom-formatted HTML document that can look exactly like your paper forms. Your customers can see something familiar, while you can still route data to any other data destination, such as your back-office systems.
Building and Testing Custom HTML/DREL Documents
- Build your desired output in HTML using a WYSIWYG editor (external link) or raw HTML, adding placeholders for where you want your submitted form data to go. If using a WYSIWYG editor, remember that you must copy/paste the HTML into the "DREL Template" box.
- Map the answers to questions using DREL - %a[QuestionLabel] - as demonstrated below. Keep in mind that if you're using the same document with multiple forms, it's best to have consistent question labels.
- Attach the document to either a test copy of your form, or attach it as an additional document available to download on a production form to ensure that the documents are not accidentally sent to incorrect recipients.
- Submit several form submissions.
- Check that all the data you want to show up has done so in the right place.
- See what happens with empty fields - do they cause strange row collapses or other layout errors?
- Fill out every field with the longest input likely to happen to test maximum width limits and word-wrap.
- Fill out every field with the shortest input likely to see how the document looks.
Note: When referencing images or sketches (photo, signature, or sketch pad questions) in a DREL template, you must do more than simply add %a[Question Label]. To reference images in a document, use the <img> tag in HTML combined with correct references.
<img src="data:%a[Question Label][contentType];base64, %a[Question Label][bytes]">
Please note that questions collecting multiple attachments will not work in the custom document. Only questions collecting a single attachment will work.