How do I work with Surveys so a response to one question triggers other questions to appear
  • 23 Jan 2023
  • 24 Minutes to read
  • Dark
    Light
  • PDF

How do I work with Surveys so a response to one question triggers other questions to appear

  • Dark
    Light
  • PDF

Article summary

This article will describe Survey QCodes and Question Branching, and how you can set up a survey so a response to one question can trigger other questions to appear in the survey.

What is a QCode and how is it used in imPowr?

A QCode is like an Identity (ID) key or code and are used to store responses to questions. By tying together QCodes from different surveys, responses can be combined, regardless of the survey being answered, the question being asked, or even of the wording of the question, as long as the QCodes are the same for each. Even if you were to change the question down the road, as long as the QCode remained the same, the wording of the question would not matter - the responses would still be stored in that same QCode and can be combined for reporting purposes.

Because QCodes are really just a storage place holder for responses, we can use them to trigger an event – the display of another question, in the survey. QCodes and the ability to logically turn fields on and off are tied together, because the ability to make fields come and go requires the use of QCodes.

An example of what QCodes can do is the following. Suppose we have a survey for which, depending on how the questions are answered, we want other questions to appear. For example, if we were to ask what city the survey taker was born in, depending on their answer, a different list of questions related to their answer could display, asking about the city. Now, suppose they answered another survey question which asks if they employed. If they selected no for their answer maybe nothing would change and only the city list of questions would appear. But, if they selected yes, in addition to the city list of questions, possibly another question would display in that list of questions, that was related to their employment within that particular city.

It is this type of survey logic which is possible vie the use of QCodes. With the use of the QCode Conditional Display Rule logic, we can turn off the display of an entire section (independent of the tab or section the referenced question is in) or we can turn on or off a question within that section. That means we can have a question on tab 2 or page 2 which is dependent on a response provided in tab 1. A way to think about this is you might have an initial tab in your survey where you ask a few questions and say proceed to tab 2. And then on tab 2 you have different questions based on how they answered the questions on the previous page and so on… and you can work your way through the entire survey doing this.

The following assumes you have been granted all privileges to view, add, and edit surveys.

How and when do you use QCodes?

QCodes are used when creating Surveys.

To access where you can create and edit surveys, click on the Form Library in the Communication section of the Performance menu.

  • Select an existing survey by clicking on its ID. (You can also create a new survey by clicking on New Form or you can copy an existing survey by clicking on its ID, clicking Copy, and then editing the copy.)

The following assumes you are already aware of how to create surveys. Creating surveys is covered in another Knowledge Base article.

_ _

Let’s say you have a few groups of people who were given an opportunity to go to their favorite restaurant or a new restaurant and rate the food and service they received. If you just want to survey them and ask who went to a restaurant, you wouldn’t need to use QCodes at all. You would just ask them who went to restaurant and they would give you their names… you would get all of the desired responses and would be done with the survey. In essence, this is how other survey tools, like Survey Monkey, work – you create a survey and answer a question, and then you can generate a report that displays the responses. But, now let’s say you want to know not only who went to a restaurant, but what restaurant did they go to, what type of restaurant it was, was it one of their standby restaurants or a new one, what did they order, how would they rate the food, and how they would rate the service they received there?

These kinds of questions are a prime example of when you would use QCodes – you would not only use QCodes to open up new sets of questions based on the individual’s response, but you would also use them when you want to look at and compare the responses provided by the many groups, each filling out their
own surveys. You can do this because, depending on the answer to the question, the QCode would allow you to display follow-on questions.

But, using that same example, if QCodes were not used, after you created that same survey and asked the same questions as above… what would happen if you wanted to provide a version of this same survey in another language? You would still want to be able to match up the responses received for each of the
survey questions and combine them into a single report. If the surveys never changed, maybe that wouldn’t be too hard to do… the response to question 1 in each survey reflecting the person’s name, would be the same, so we would gather those responses. If the response to question 2 was always whether they went to a restaurant or not, we would gather those responses. If the responses to question 3 was always the name of the restaurant they went to, we would then gather those responses. We would continue doing this for all of the questions, and once we had all responses to all of the questions, we would gather them together in a single report and list them out.

Even though this does not appear to be very difficult, not only is it time consuming, but this isn’t how things always work. Sometimes, someone might look at one of the surveys and say, I think question 2 and question 4 should be swapped. Or next month, they may say question 2 should be re-worded. Either of these scenarios would have a direct impact on the responses you captured, because the questions wouldn’t match up any more. At imPowr, we tried to take the potential for these changes in mind by creating QCode which can be used to store the question's response regardless of how the question was worded or where it is located in the survey.

How do we Set-up QCodes?

Before we generate QCodes, we have to decide if we want the question's response stored for reporting purposes, or if we want the data stored AND we want the database updated with the newly entered information.

Data Mapping Methods

This means we have 2 Data Mapping Method options to choose from:

  • Store the data for reporting by QCode (Typical choice for Surveys)
  • **Map data to entity objects such as accounts, services, or referrals **(Typical choice for Form based input)

The first option, Store the data for reporting by QCode (Typical choice for Surveys), will store the response received for that question in that QCode.

The second option, **Map data to entity objects such as accounts, services, or referrals **(Typical choice for Form based input), will store both the question response in the QCode AND will also update the imPowr database.

How to choose the one to use:

Choosing the proper Data Mapping Method comes down to whether or not you will want to update the database with the response received.

But, regardless of whether you want to store the data or not, keep in mind that QCodes are also used to turn on and off the display of questions. For Example: If I had a question and an associated QCode in section 1 of my survey that I wanted to tie to a QCode in a different question in another section of the survey, I might ask if that would be possible? The simple answer to this question is yes. Using QCodes to move between questions in a survey will work with either method of Data Mapping. But you should be aware of one thing... let’s say, question 1, in section 1 of your survey might ask for a user to respond whether a particular kind of situation has happened in your facility before. But then, later on, in another section or page of your survey, the same question is asked again, and a different answer is provided than was provided in the first section. In that scenario, the QCode will reflect the last answer provided and not the first.

While this could be construed as being challenging because you now have 2 responses for the same question, if you have selected Data Mapping Method of **Map data to entity objects such as accounts, services, or referrals **(Typical choice for Form based input) instead of the **Store Data for reporting by QCode **(Typical choice for Surveys) Data Mapping Method, the new response could actually be beneficial to you, because you can use this new information to update the database in your system. When you select this Data Mapping Method option, there are not as many options for where to store the data, but when selecting this option and the entity where you want to store the data in, the responses to questions are not only logged to the survey for that question, but they are also actually stored directly in the database (for the selected entity) and can update the information stored within imPowr. For example: suppose your question asks the user to enter their middle name. Their response can overwrite the middle name in their account profile if you chose the Data Mapping Method of **Map data to entity objects such as accounts, services, or referrals **.

Once you select this Data Mapping Method entry, the next time a user logs to take the survey, when they answer that survey question, their current entity entry will be displayed, and the user will have the ability to overwrite that entry if desired.

Data Mapping Method Set-up

To select one of these Data Mapping Method options…

  • Access a specific survey by either creating a new survey or editing an existing survey.
  • Select a specific question and click on Edit.

  • Navigate to the Data Mapping
  • Select either the Store the data for reporting by QCode or the Map data to entity objects such as accounts, services, or referrals Data Mapping Method, by clicking on the appropriate radio button.

If you have selected the Map data to entity objects such as accounts, services, or referrals, a new selection line will appear in the panel for you to select the Data Element that you will want to update in imPowr.

To select the Data Element to update…

  • Click Choose.
  • Select a Data Element by highlighting the element and clicking on Select.

NOTE: When you select Data Elements for the **Map data to entity objects such as accounts, services, or referrals **Data Mapping Method, those data elements are based on an Entity object such as accounts, services, or referrals. Only a single entity object can be selected for each survey. This selection is done in the survey settings screen.

  • Once in the settings screen, navigate to the Optional Data Mapping panel.
  • Choose the Primary Entity from the drop-down list of Entities.

This selection will allow you to update the database for the Account, Account Program, Incidents, or the Organization Entity screens.

Depending on the Entity selected, different Data Elements will be available to select from.

_NOTE: The Data Mapping Method of _Map data to entity objects such as accounts, services, or referrals _(Typical choice for Form based input) is not always applicable. As noted previously, there are a limited number of fields that can be updated in imPowr, depending on the Entity selected. Current design only allows for Account, Account Program, Incident, and Organization to be updated. You can view which account fields (i.e. which data elements) can be updated by selecting this option, choosing the desired Entity, and proceeding to the next step of selecting your Data Element. _

If you should decide that this Data Mapping Method is not the right one for your survey, you may change the method by selecting the other option at any time – before or after you create QCodes.

QCodes

Once you have completed the Data Mapping Method selection, you can now set-up your QCodes.

Generating QCodes

There are 2 ways to generate QCodes for a particular survey question:

  • Auto-Assigned by imPowr
  • Manually Assigned

Even though you know a QCode is a place holder for the responses to a particular survey question, you might be asking yourself ‘What exactly are QCodes in imPowr?’.

An example of an Auto-Assigned QCode, generated by the imPowr system, (which appears on the Edit screen for a particular question after you click Auto-Assign) is F21Q751.

The syntax for this QCode refers to the survey, as well as an internal generated number for the question. Example: QCode F21Q751 refers to (survey) Form number 21, question 751 (this is an internal system generated number for the question).

While this kind of QCode works fine for surveys, there is another, more meaningful way to generate and display QCodes. In the imPowr Data Dictionary… there is a list of Data Elements, which are the QCodes.

Data Dictionary

You can access the Data Dictionary from the Data Management section of the System menu.

Every time the system Auto-Assigns a QCode for you, it adds that QCode (example F21Q751) to that library. But, within the library, you also have the ability to create (or edit the system generated) QCodes into something more meaningful. You can define a QCode with a unique name for pieces of data. Example: you can define a QCode as a “RestaurantID”.

  • Click New QCode.
  • Enter the Name for the QCode.
  • Optionally select a **Category **from the drop-down list (the categories are all arbitrary)
  • Select a Data Type from the drop-down list (example: Text or Numeric)
  • Optionally enter a Description for the QCode.
  • Click Save.

Now, when you set-up a survey, you can link the question to this more meaningful QCode.

If we were to go back into that specific survey question, in the Data Mapping panel in set-up for that question, you can choose this QCode instead of having the system Auto-Assign a QCode for you.

  • Click Choose to select the more meaningful QCode that you created for this question.

  • Choose a QCode from the list by searching through the list and clicking on the desired QCode to highlight it.
  • Click Select.

When the response is entered for that question, it will get stored as RestaurantID. That way, when you create a different survey, you can have another question about the restaurant type and you can also link that question to the same QCode…and even if the questions are different, the survey will always know which one contains the RestaurantID answer and if desired, the data can be combined into a single report.

Using QCodes in the Survey

Sometimes, when people create a survey, they may also decide to create the survey in another language, or they might want to add optional sections based on the questions in the survey. In this kind of situation, it is probably best to go into the survey question and click Auto-Assign to have imPowr create a unique QCode for you. And, if you didn’t like that name, you could always go to the Data Dictionary and rename it.

But, if there are a lot of questions in the survey, you might not want to have the headache of going into the Data Dictionary and updating all of the entries to make more meaningful QCode descriptions.

So, another way you can do this is…

  • Click on Settings in the main survey (not the survey question settings).

  • Navigate to the QCode management panel.

If you click on Auto-Assign Missing QCodes, the imPowr would go through all the questions in your survey and if any questions did not have a QCode, it will create one for you.

After clicking on this button, all you need to do is Confirm auto-assign of blank QCodes, and they will be created.

You can also clear all QCodes from your survey if desire by clicking on Reset QCode References. You can remove the ones you auto created by clicking on Reset Auto QCodes Only.

Once you have QCodes created and assigned to your survey questions, you can view the QCodes by selecting the Checkbox Show QCodes in the survey. The QCodes will immediately display in the survey at the end of each question, in brackets.

We can then use these QCodes to collect data.

Continual Care recommends even if you are not going to use a QCode now, that you include them in your surveys, in case you decide to use them later.

Conditional Display Rules

Along with linking questions, QCodes provide the ability to allow questions to appear or not appear in a survey, based upon a prior response. The way this logic works is if I have a question and want to add a new follow-on question, an Optional display rule can be entered into the Conditional Display Rule panel which is located within the Special Behaviors panel.

Once the Conditional Display Rule logic is entered, you would be able to display that question only if the QCode = xXXXX. (The Display Rule syntax is @QCode1 = ‘XXXX” where QCode1 is the QCode (either the auto-assigned one or the manually selected QCode) and XXXX is the entry which will trigger the display of the question. Once the rule is saved, you can preview it.

Important to note: For text boxes, there are no events which trigger the conditional rules. Therefore, when trying to preview your survey, to test whether or not the rule is working, you can go to another tab and come back and that action will trigger the event, which in turn will apply the rule. Another way is to select a different kind of data entry method in the Input Style panel in the question set-up, that is not a text block (i.e., a field on the survey for the respondent to enter free text).

Conditional Display Rules are triggered from and work with either text or values. If you select a Conditional Display Rule that has a text trigger, the Data Entry Method must also be text-based (e.g., a Checkbox List (Text), a Dropdown List (Text), etc.). Conversely, if you select a Conditional Display Rule that is triggered from a number, the Data Entry Method must also be numeric-based (e.g., a Checkbox List Value, a Dropdown List (Value), etc.).

As mentioned, the Conditional logic syntax must be in the format of @QCode1 = ‘New York’ where QCode1 is your QCode. There must be quotes around the text entry you want to trigger the display of the subsequent question (example: ‘New York’). If you use values, the Conditional logic syntax must be in the
format of @QCode1 = 1, where again, the QCode1 is your QCode and there shouldn’t be any quotes around the value (you just treat it as a number). Once entered, these Optional Display Rules will be used to trigger the display of the subsequent question.

_NOTE: If you select Conditional Display Rule based on a trigger for Text, and your Conditional Display Rule is to select a value (example: @F42Q836 = 1), the event will not be triggered, and the display will not occur. _

This is one area that most people have run into issues with – just keep things consistent. If you want to display a question based on the value of the response from another question, then make sure your Data Entry Method reflects a value and the value is used in the Conditional Display Rule. If you want to display a question based on a text response from another question, make sure your Data Entry Method reflects Text. Choosing the value is probably the better way to do this – that way you can change the text without changing the submissions.

_The applicable data entry methods for QCodes are: the Checkbox, Pickers (Date, Month, Year, State, Country), a Drop Down list, or a Radio Button. When you use the Checkbox list, it is a multi-select control... if you select more than one thing, you get a response with a “pipe” (|) delimiter. _

_For example, a person may select “HEAP” and “Other” in a survey about Government Services they are currently receiving and you’d get either “Heap|Other” as a response (if the Checkbox (Text) was selected) or “3|4” (if the Checkbox (Value) was selected). That will store as a Qcode for reporting purposes. _

However, if you are trying to use the selections for conditional logic, that would be problematic. In theory you should be able to set up a logical element like “QCode=”Heap|Other”. But, since there are so many possible combinations, it wouldn't really be practical and it would rarely work because “HEAP|Other” is different than “HUD|HEAP|OTHER”.

Perhaps in the future there could be new syntax available such as:

  • “QCode Contains “HEAP” (where imPowr uses “contains” instead of “=” and this would be true if HEAP was any of the selections)
  • “QCode NotContains “HEAP” (where imPowr users “notcontains” instead of “=” and this would be true if HEAP was NOT any of the selections)
  • “QCode ContainsAnything” (where it is true if anything is selected)

But right now, imPowr only utilizes the equality operation (and perhaps not equals <>) so those additional options are not available.

Bottom line is that if you want to do conditional logic, you’ll need to leverage single-select options and not multi-select.

For example,

  • Do you utilize one of your programs (Yes/No)? --- with either a radio button or dropdown list or other single select item. Then do conditional logic off this one.
  • Select them below (multi-select): (no logic – just data storage)

QCodes in Reports

The data collected by QCodes can be used in a variety of reports such as to answer the question: For this kind of survey, how did people respond to QCode FxxQxxxx?

You should use QCodes when you want to compare something year to year, like program satisfaction. For example, in 2020, you might want to ask people if they are satisfied with the program services they are receiving. In that situation, you would create the survey and QCodes and would link that question
to a particular QCode. Now, next year, in 2021, you want to run the survey again (so you can compare the results to those collected in 2020). Using the same QCode will allow you to collect the data from both surveys. But, what if someone comes back to you and says they don’t like that question and say this year they want it rewritten to ask ‘does the program meet your needs?’ Well, if you want to be able to compare the answer you get in 2021 to the answer you received in 2020, you’d be able to as long as the same QCode was used. With the same QCode, it does not matter how the question is worded – all you are doing is collecting similar related responses. And if you did do that, in essence, you would be saying give me all of the responses related to program satisfaction, regardless of what year it came from or what language the survey was in or whether it was the full survey or a mini survey (a subset of the full survey), because they are all linked to that QCode.

After reports have been submitted, you can view the QCodes for the Submitted
Surveys
.

  • Access Submitted Surveys in the Client Events section of the Engagement menu.

  • Select a survey by clicking on its ID.
  • Display the QCode by checking the QCode
  • Check the Question ID box to optionally display the internal system generated question ID.

NOTE: You might have to click on the Refresh icon for the QCode and Question ID to display, after checking the respective boxes.

Displaying this information will help you when you create reports or are comparing different surveys. For example, when comparing a Spanish survey to an English survey, it does not matter which survey is completed by respondents, because we can combine the results based on the QCodes.

The following is an example of the answers when they come back into imPowr from the Survey Portal and how it looks with the QCodes displayed.

When comparing multiple surveys, there are more details, but the QCodes are still displayed:

If there are multiple answers possible for, the survey response is displayed with a pipe delimiter separating the responses:

Testing

Once a survey is created, you can display the survey by clicking on the Preview button.

When you do this, the entire survey is displayed (if there are multiple pages, the pages will display as tabs across the top of the screen).

In addition to viewing survey questions after you created a survey, if you entered QCodes on that survey, and entered Conditional Display Rules which automate the display of questions based on responses to other questions, you can test to see if the logic you have tied to them work or not.

One of the things you need to watch out for is, when you create the entire survey and test it by clicking on Preview, you will see all of the sections displayed and no automation of the survey will occur (i.e., the QCode logic will not be applied). This has been set up to perform this way by default, so you can work on the portion of the survey that you want, not just the entire survey. (A lot of times when a user goes to Edit the survey, they don’t want to mess around with jumping between sections and answering the entire survey – they just want to get in there and look at one thing. So, imPowr defaults this way.) If you want to test the business rules / automation within the Preview, you will need to check the box Apply Business Rules on Preview (if enabled) at the top of the screen.

Please make sure the survey also is set for Enabled Business Rules.

  • Click on Settings.

  • In the Form Display Options panel, make sure the Enable Business Rules box has been checked (i.e., the “enabling” referred to in the Apply Business Rules on Preview (if enabled)”).

  • Click Save to save your settings and be brought back to the display of the survey.
  • Click Confirm to confirm the saving of your Form settings changes.

  • Once these boxes are checked and saved, when you click on Preview, you will be able to walk through the automation in your survey (the displaying of questions depending on the answer to another question).

_NOTE: If the automation does not work, go back into surveys to make sure these boxes are checked. Also check to make sure the Conditional Display Rule type (Text or Numeric) matches the type used in the Data Entry Method. _

NOTE: If you decide you don’t want the automation performed on preview or within the survey any more, just uncheck the Enable Business Rules box.

Summary

Create survey as you have done.

When you get to the end, look at your questions and see if you think you might use that information in logic or from year to year or multi-languages – if you are, create QCodes. If you are willing to put in the work, the preferred way is to go to the Data Dictionary and create meaningful QCodes for your surveys. It’s nicer if you can have real words as QCodes in your survey instead of the system generated ones. Then use those QCodes in your survey logic, taking them into account when you run your report.

After the surveys are responded to, select the desired surveys from the Submitted Surveys list, run the pivot data and export it…. or run the raw data and look at it (it is really the better way, but not as easy to use - it contains everything and is normalized versus the pivot data. If someone wants to pivot this or graph it, anyone who knows excel (an advance user) can do all that with this.) If they want to compare results between multiple surveys, they will also have this information at their fingertips.

And, after you have a report you like, you can display the same information via datasets and ultimately display it in a dashboard. (For example, you can create reports/datasets that can display answers to questions like ‘for Question 1, how many people answered A, B, C, or D?' to be shown on your dashboard.)

DISCLAIMER: The characters, names, and events contained in our training documents and in our demonstrations are fictional. Any resemblance or similarity to any actual events, entities, or persons, whether living or dead, is purely coincidental and are purposely made for better visualization of the
functionality of our software.


Was this article helpful?