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.
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
After you add the code to the editor, click Refresh View to view the UI.
Add the details that you want to save with the extended schema and go to any of the survey questions to view the details.
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.
Select the question you want to add a custom message.
Click on the edit option and go to the Data tab
Change the Custom message. (This change will only be applicable to this question.)
Sample JSON scripts
To find sample JSON scripts:
Go to the Schema listing page.
Select any Schema, open the options menu (), and select Edit.
Click the “question mark” icon next to the Schema Editor.
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.
To create an External Hook, open the Expressions tab.
Add a condition to trigger External hook.
Select the Action as External hook from the drop-down.
Enter your message within double quotes in the External Hook field.
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,
Create or select a survey and select Edit from the options menu.
In the Survey Designer tab, select a question and click Edit.
In the Choices tab, enter scores for each of the responses in the Data field.
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.