Part 1 - Creating a survey template

Overview

We'll start by creating a space template for the survey.

By the end of this section you will have something that looks like this:

Source code

The following source code is shared using Confluence Storage Format - the XHTML-based format that Confluence uses to store the content of pages, page templates, blueprints, blog posts and comments.

For more information on how to use this source code on your Confluence, read the following article - How do I use Recipes that use the Storage Format with the Confluence Source Editor?

<table class="relative-table wrapped" style="width: 35.6164%;"> <colgroup> <col style="width: 33.8983%;"/> <col style="width: 66.1017%;"/> </colgroup> <tbody> <tr> <th>How do you rate our services?</th> <td> <div class="content-wrapper" title=""> <ac:structured-macro ac:macro-id="0a3e35ed-70b3-408b-8e2c-a31ce298de19" ac:name="list-data" ac:schema-version="1"> <ac:parameter ac:name="name">rate</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <ac:structured-macro ac:macro-id="70250c28-8baf-40c5-afd2-ee8ce9393c36" ac:name="list-option" ac:schema-version="1"> <ac:parameter ac:name="sortValue">1</ac:parameter> <ac:parameter ac:name="label">5 - Very good</ac:parameter> <ac:parameter ac:name="value">5 - Very good</ac:parameter> <ac:rich-text-body> <p> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="5a236976-a74e-4e84-8883-4c844e4513d4" ac:name="list-option" ac:schema-version="1"> <ac:parameter ac:name="sortValue">2</ac:parameter> <ac:parameter ac:name="label">4 - Good</ac:parameter> <ac:parameter ac:name="value">4 - Good</ac:parameter> <ac:rich-text-body> <p> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="0f0b402b-f8ea-42ab-a0b1-10eba197e683" ac:name="list-option" ac:schema-version="1"> <ac:parameter ac:name="sortValue">3</ac:parameter> <ac:parameter ac:name="label">3 - Neither good nor poor</ac:parameter> <ac:parameter ac:name="value">3 - Neither good nor poor</ac:parameter> <ac:rich-text-body> <p> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="69ba5f41-880a-4b53-b117-67d809f6b350" ac:name="list-option" ac:schema-version="1"> <ac:parameter ac:name="sortValue">4</ac:parameter> <ac:parameter ac:name="label">2 - Poor</ac:parameter> <ac:parameter ac:name="value">2 - Poor</ac:parameter> <ac:rich-text-body> <p> <ac:emoticon ac:name="yellow-star"/> <ac:emoticon ac:name="yellow-star"/> </p> </ac:rich-text-body> </ac:structured-macro> <ac:structured-macro ac:macro-id="15c2e48b-0e67-473a-ba07-f962e67160fd" ac:name="list-option" ac:schema-version="1"> <ac:parameter ac:name="sortValue">5</ac:parameter> <ac:parameter ac:name="label">1 - Very poor</ac:parameter> <ac:parameter ac:name="value">1 - Very poor</ac:parameter> <ac:rich-text-body> <p> <ac:emoticon ac:name="yellow-star"/> </p> </ac:rich-text-body> </ac:structured-macro> </ac:rich-text-body> </ac:structured-macro> </div> </td> </tr> <tr> <th>How can we improve our services? </th> <td> <div class="content-wrapper"> <ac:structured-macro ac:macro-id="1512ec7d-d7ca-4f3b-b0fa-20172be4a1c7" ac:name="text-data" ac:schema-version="1"> <ac:parameter ac:name="name">comment</ac:parameter> <ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter> <ac:rich-text-body> <p> <br/> </p> </ac:rich-text-body> </ac:structured-macro> </div> </td> </tr> </tbody> </table>



Steps

On your space

  • go to Space tools > Content Tools > Templates

  • choose Create New Template

  • set the title of the Template to "Survey"

In this draft template

  • add a 2x2 table

In the first column

  • in the first row cell type add "How do you rate our services?"

  • in the second row cell add "How can we improve our services?"

In the second column

  • in the first row add a List Data macro

    • set the Name parameter to "Rate"

In this List Data macro

  • nest five List Option macros

    • for the first List Option macro

      • set the Value and Label parameters to "5 - Very good"

      • set the sortvalue to "1"

    • for the second List Option macro

      • set the Value and Label parameters to "4 - Good"

      • set the sortvalue to "2"

    • for the third List Option macro

    • set the Value and Label parameters to "3 - Neither good nor poor"

    • set the sortvalue to "3"

    • for the fourth List Option macro

    • set the Value and Label parameters to "2 - Poor"

    • set the sortvalue to "4"

    • for the fifth List Option macro

      • set the Value and Label parameters to "1 - Very poor"

      • set the sortvalue to "5"

The List Option macros are used to add the available options that the user can choose from. Use the sortvalue parameter to set the position in the list of options.

Also in the second column

  • in the second row add a Text Data macro

    • edit the Text Data macro

      • set the Name parameter to "Comment"

This is a text entry box allows a user to add a written comment to suggest improvements.

  • Save the page

Macro structure

Next

Part 2 - Adding a Create Survey link