How do I use advanced survey features?

Orbita introduces advanced features to surveys that make the user engagement experience even better. Administrators can create customized surveys that will show questions to the users based on responses within the surveys.

Advanced Survey Features includes:

 

Extended Schemas

Using extended schemas, admins can add custom data as a key/value pair to all the questions within a survey.

  1. Open the admin view of extended schemas. Admins can add JSON scripts in the editor. For sample scripts, see Sample JSON scripts.

    An extended schema supports:

    • Text

    • Rich text

    • Number

    • Date

    • Select dropdown

    • Radio group

  2. After you add the code to the editor, click Refresh View to view the UI.

  3. Add the details that you want to save with the extended schema and go to any of the survey questions to view the details.

  4. Go to a survey question and select the edit option and check the Data tab. You can also add a custom message to each question individually.

  5. Select the question you want to add a custom message.

  6. Click on the edit option and go to the Data tab

  7. Change the Custom message. (This change will only be applicable to this question.)

Sample JSON scripts

To find sample JSON scripts:

  1. Go to the Schema listing page.

  2. Select any Schema, open the options menu (), and select Edit.

  3. Click the “question mark” icon next to the Schema Editor.

  4. Select the type of script you want to refer to from the list of schema provided in the dialog box.

Alerts

You can create alerts with or without conditions. The fourth pin in the survey node gets the output of alerts.

  • With Condition

    When the condition is true, an alert is triggered at the end of the survey.

    You can create a custom message or action to be displayed or executed if the conditions are met.

    Expression code changes dynamically based on the conditions assigned.

  • Without Condition

    When you create an alert without a condition, the alert is triggered at the end of the survey.

    On the clinician’s end, the alerts is categorized into the following Labels:

    • Danger

    • Information

    • Success

    • Warning

Expression

Expressions can be created in two ways,

  • From the edit window within the survey question.

    Actions for the expression include:

    • Visible if. The question is visible if the condition is met.

    • Goto. If the condition is met, the survey will skip to the question specified.

    • External hook. If the condition is met, the output of the survey question can be customized. The text that you give in the external hook is passed through the 6th pin of the Survey node.

  • From the Alert window. See Alerts.

External Hook

External Hooks will let the admin customize a message or trigger an action within a survey.

  1. To create an External Hook, open the Expressions tab.

  2. Add a condition to trigger External hook.

  3. Select the Action as External hook from the drop-down.

  4. Enter your message within double quotes in the External Hook field.

  5. Click Apply and click OK.

In the Experience Designer, External hook output (your message) is sent to the 6th pin of the Survey Manager.

Attach a function node and feed the output of the function node back to the survey manager. This allows the survey manager to continue with the survey questionnaires.

For example, consider a survey with the following questions:

  • question 1 (single input)

  • question 2 (single input with external hook) with something like Externalhook("your message")

  • question 3 (rating question)

When the user answers to question 1, then the external hook in question 2 gets triggered and it is processed in OE and sent back to the Survey Manager (as shown in the previous image).

The next question displayed to the user is question 3.

Scoring User Responses

You can tag scores to user responses. At the end of the survey, you can get the scores of the responses using the following code.

msg.payload.orbita.survey.completedSurveyQuestions[0].getDataOption();

Note: Only the following types of questions can score user responses:

  • Checkboxes

  • Radio Group

  • Rating

  • Dropdown

To create a survey with scores,

  1. Create or select a survey and select Edit from the options menu.

  2. In the Survey Designer tab, select a question and click Edit.

  3. In the Choices tab, enter scores for each of the responses in the Data field.

  4. Save the survey.

Risk Stratification

Based on the scores from the user responses, you can classify the users into different risk levels; and you can create custom alerts based on the risk levels.

The following example shows a sample survey flow to classify the users into risk categories and create an alert for the users with high risk.

  • The Function node contains the code that lets you capture the data (Scores) of the user responses and add them.

  • The Dynamic data node creates an alert if the sum of the scores is above a specified number.

You can use the following custom code in the code editor for the Dynamic data node, which specifies how the alert is to be created.

{     "tag": "Blood Pressure",     "level": "warning",     "user": "12345",     "assignTo": "45678",     "text": "sample text",     "status": "open" }

Post-Processing with Experience Designer

Dynamic Listener Flow describes post-processing data with Experience Designer.

Auto-generate Slots

Project-specific surveys have a checkbox for generating slots automatically. (Global surveys do not have this checkbox).

Project-specific survey screenshot

If you enable Auto Generate Slots, slots are created for all of the choice and button values of survey questions. These slots are mapped in the intent named OrbitaSurveyMessages.

Related Articles