Demonstration 31 Part 3
Demonstration 31 illustrates how to use multiple pages with forms. This lesson will consist of 3 separate parts, one part per form page. In Demonstration 31 part 3 you will learn how to:
• Use SQL Databind to your fields
• Display your final results
• Send an email with your results
How to Get the User's Results?
Part 1
Place a label on the form for each field that the user has filled out on the previous two forms. If the user ended up filling in 15 fields, then you might want to place 15 labels on the form, this really depends. You may have the user fill out parts of the form that you wouldn't like to display in the results form. But practically, one label per item you have stored in your data table that you wish to display.
In order to bind data from your data table to your results form, you will need to go to "Module Configuration" and expand the "Inital SQL Rendering/Bind". From here you will check the checkbox that labeled "Enable initial SQL data bind". In the "Initial SQL Query" multilined textbox you will insert a query like so:
SQL Rendering/Bind:
By adding this query you are selecting all of the data from the data table from the specific form you just filled out. There is a mandatory rule when using SQL Rendering/Bind. All of the labels that you have on your form must have the excact same shortname as the data table's column names. For instance: I have a label that I would like to represent the full name of the person that filled out the form. This shortname must be identical to the column name in which the full name is stored.
Part 2
If you wish to send an email full of the user's information then you need to also add hiddens field. You'll have to add DSParam1 as a hidden field in the results form. If you have 15 labels, you will have 16 hidden fields(one more hidden field than labels because of DSParam1). The hidden fields will have the same shortname as the corresponding table column names. So in essence the hidden field shortnames will be the same as the label shortnames, corresponding of course. For instance: If you have a label with the shortname Fullname then you will also have a hidden field with the shortname of Fullname.Now since the data has been binded to the hidden fields, you now have existing tokens that you can reference when creating an email completion event. Like the example:
Hidden Fields and Labels:

With all of this information available as tokens, you have endless possibilities of how you can format the email you are sending. But in this case, Demonstration 31, we are going to send the person that is filling out the forms, their results. This way they can see all of their information before submitting it. Also note, an email will not be sent if the checkbox from the first part of this Demo isn't checked. If this checkbox is checked then your results email will be sent.
Checkbox that the Last Form References:

Configuring your Email Event:

Summary of Demonstration 31 Part 3
• You have learned how to display all of your results from SQL Rendering/Bind
• You have learned how to add hidden fields and fill values into appropriate hidden fields by using SQL Rendering/Bind
• You have learned how to put together an email full of results for the person who filled the form
• You have learned how to reference the checkbox that will determine if a results email is sent or not
This concludes the entire Demonstration 31. If you have any questions or comments please add a comment at the bottom of the Demonstration 31 Part 1 page.
This concludes Demonstration 31