How to create a Document Wizard form
Date: 15-Oct-2010
This is an overview for creating a 'Document Wizard' form type (accessible at /_admin/survey.asp)
In a Document Wizard form data from the form is collected and saved to the database and upon submission the system will generate a PDF document with the form’s answers merged in to a base template which can be downloaded by the user.
Note: this alternative form type is not part of a standard populus implementation so may not be available on all sites. Please contact your account manager if you wish to have this function enabled.
Setting up the Document Wizard
- Create a form with the relevant questions for your document wizard the same way you would for a standard form
(more detailed instructions for this may be found here: How to create a form)
- On the Form Set Up page in admin, set the 'Form Type' field to Document Wizard and 'save' the form.
- After saving the form, you will see an addtional option on the form sub-navigation for 'Document Wizard' click on this to go to the Document Wizard set up page.
- On the Document Wizard set up page you will find a list of available data replacement fields which you can incorporate in to your PDF template. These are listed as 'Available Fields' and correspond to the questions that have been set up on the form, e.g. [Q1], [Q2], [Q3], etc.
- At the bottom of the Document Wizard set up page there is a WYSIWYG text editor box. You may use this to create and format the content of the base template for your final PDF document. Use the replacement fields (e.g. [Q1], [Q2], [Q3]) wherever on the template you would like the answers/data to appear that the site user submits on the online form.
Question Types
There are some addiitonal formatting options available to you when setting up
- The output format of a multi-select question will automatically output as a comma separated list on the same line.
- if you use the tag - [ID3,bullet] then it will output the result as a bulleted list, semi-colon separated at the end of each line.
- You can cause any part of the output template to NOT display by using the following tags for multi-select, dropdown and radio button questions. See example below.
- identifies the question the instruction relates to, and the answer option that if selected will cause the indicated part of the document to be hidden: [ID6,hide='answer ID']
- identifies the beginning of the text to be deleted if the user answer selects the identified answer option: [CONTENTID6,start]
- identifies the end of the block that will be deleted: [CONTENTID6,end]
- If you use the tag [CONTENTID6,display='answer ID'], then if the end user selects that answer option it will simply display the text as is without any of the tags (and without adding or removing any text)
- the display/hide tags can be used together for the same question
- You can combine these two parameters as follows: [ID6,bullet,hide='answer ID']
- If you wish to include a page break in your pdf then use the property:
- page-break-before: always can be used with the following tags:<BR>, <IMG>, <HR>, <TABLE>, <DIV> (eg. <BR style="page-break-before: always"> )
- page-break-after: always can be used with the following tags:<BR>, <IMG>, <HR> - If a user does not add any content to a freeform field then when the document generates, the routine will simply remove the relevant tag.
- The start and end tags can be used in conjunction with the freeform field to remove a section of text if the user chooses not to add any content. For example, if the document included the following: "We attended the first performance. [CONTENTID24,start]Our impressions of the performance were that [ID24].[CONTENTID24,end] There are other performances on Wednesday." then if the user didn't add in any content in the freeform for ID24 then the output would be "We attended the first performance. There are other performances on Wednesday."
Here is an example:
Question is: Does the event occur near a residential zone or some other amenity?
Answers:
1= It is a high density neighbourhood.
2 = no
3 = yes
4 = There are a number of amenities.
The text in the wizard template is:
[CONTENTID24,start]The event will occur near residential zones and neighbourhood amenity is considered in event planning and delivery.[ID24,hide=2,display=3][CONTENTID24,end]
The output into the document for the various combinations will be as follows.
- user selects 1 and 2: nothing will appear in the final doc. Because the user selected 2, then it removes all the content between the start and end tags, including the tags
- user selects 1 and 3: "The event will occur near residential zones and neighbourhood amenity is considered in event planning and delivery. It is a high density neighbourhood."
- user selects 2 and 3: nothing will appear in the final doc. Because the user selected 2, then it removes all the content between the start and end tags, including the tags
- user selects 1, 2 and 3: nothing will appear in the final doc. Because the user selected 2, then it removes all the content between the start and end tags, including the tags
- user selects 1, 3 and 4: "The event will occur near residential zones and neighbourhood amenity is considered in event planning and delivery. It is a high density neighbourhood."
Please note:
The Document Wizard option can also be used for more complicated PDF templates. For example you may want to map or mail-merge data collected on the online form on to a pre-existing PDF form. For further assistance or for a quote to utilise more advanced options on the document wizard, please log a support call.
