Day 11: The Formatted Question
Previous Topic  Next Topic 

In the last lesson we asked you to. If you have not done that, go back and do it now before continuing with this lesson.

This lesson will show you how to set up a FORMATTED question with character restrictions so that you  must enter data in a formatted string.


The FORMATTED question should only be used to set up questions that require a fixed amount of specific characters i.e. a National Insurance Number. It is strongly recommended that you do not set up a FORMATTED question for questions that require variable answers such as names or addresses. Each user’s personal details will differ in character length / type.

Now do the following.

    1. Create a new survey and save it “Day 11”. In the MAIN SECTION create a DIRECTED section entitled “PERSONAL DETAILS”. Within this section you will build four simple questions, start by creating a TEXT question with the question prompt “Name”.

    1. The following question in your PERSONAL DETAILS section should be a MENU question with the question prompt “Wine Type”. Add two FIXED choices, “Red” and “White”.

    1. Add a TIME question entitled “Date of Birth” by selecting the TIME tab and choosing INPUT DATE from the list to the left of the question definition dialog. This question will allow you to select a date from your system calendar rather than inputting the data manually.

    1. Now create another MENU question. Give it a question prompt of “Gender” with two choices, “Male” and “Female”. INSERT this question and you should find you have four questions within your PERSONAL DETAILS section.

    1. In the MAIN SECTION you should see QUESTION ZERO entitled “Survey Identifier” followed by the PERSONAL DETAILS section. Click on question zero and select the FORMATTED tab from the question definition dialog. Give it a question prompt of “National Insurance Number”.

    1. You will notice the parameter to the left of the question definition dialog entitled FORMAT STRING with written instructions underneath. A format string sets a question with character restrictions so that data must be entered in a formatted string. Referring to the code beneath the FORMAT STRING BOX, enter the following text:

“AA 99 99 99 A”

    1. This formatted string ensures your answer to this question will be structured as above. An upper case “A” ensures the data you enter must be an upper case letter, and the number “9” restricts you to whole numbers.

    1. MODIFY your question zero and SAVE your survey. Click RUN and you will be prompted to enter your NATIONAL INSURANCE NUMBER. The string will be displayed to show how the data you enter will be formatted. Try entering an illegal character, for example a number. You will notice an error message “Illegal Character”. The format string restricts this data entry, as it first requires a letter. Enter your National Insurance Number or complete the FORMATTED question by following the FORMAT STRING. Click OK and confirm your data is correct.

    1. Complete the rest of the survey by filling out your PERSONAL DETAILS. Click QUIT and then RECEIVE your data back on PocketSurvey. OVERWRITE any existing data if necessary. Click TOOLS | QUICK EDITOR | “Day 11single item” to view your formatted answer and personal details in the DATA DOCTOR.

The next lesson you will learn all about the MESSAGE question, integrating the use of basic HTML commands.

Final Tip

FORMATTED questions are not restricted to question zero. They can be similarly used at any point in a survey enabling you to enter data in a formatted string. Try thinking of some different questions that require format strings and how you could create a survey built around this.

HandHeld Systems Ltd ©