If you would like to include a survey that isn’t already in the Veeva Library or your customer library, you can configure it using the JSON editor in MyVeeva Studio. The JSON editor uses line-by-line error messages to guide you while you design a survey using JSON. See Sample JSON Survey, Schedule, and Notification Templates for Veeva sample templates that you can use as a reference to configure your own surveys using JSON.
Configuring a Survey Using the JSON Editor
To create a new respondent or site survey using the JSON editor, complete the following steps:
- Navigate to a collection.
- Select Edit.
- In the Surveys tab, select Add Surveys.
- From the drop-down menu, select Create New Survey.
- When the Create New Survey page opens, use the Survey Configuration field to configure your survey using JSON.
- You can select the Preview Survey icon (
) to preview your survey while you create it. See Previewing a Survey for more information.
- Populate the following fields to the left of the JSON editor.
- Display Name: This is the name that respondents see when they receive the survey.
- Add to Library: Whether the survey will be added to your customer library as a reusable survey. Select Yes or No.
- Selecting Yes adds the survey to your customer library for future reuse once this collection is approved.
- Selecting No won’t add the survey to your customer library.
- Reviewed: Select Yes, No, or N/A. See Tracking Reviewed Surveys for more information.
- Licensed: Select Yes, No, or N/A. See Tracking Licensed Surveys for more information.
- Respondent Burden: Select a value for the burden of the survey. The respondent burden is the perceived difficulty of the survey from a respondent perspective. Options include Very Easy, Easy, Moderate, Hard, and Very Hard.
- Note that when editing the survey, other fields may become available. See the following sections for more information:
- Select Save.
MyVeeva Studio JSON Resources
See the following resources for more information on the JSON:
- Universal Survey Parameters
- Universal Survey Block Parameters
- Available Block Types
- Configuring Conditions
Configuring As-Needed Display Name
As-needed surveys may be completed multiple times throughout a study. The As-Needed Display Name can be configured to indicate a repetitive task such as “Log Exercise” or “Log Food Intake”. You are required to specify an As-Needed Display Name if one or more schedules for this survey has an available type of “asNeeded”. See Configuration Parameters for Schedules for more information.
Configuring Survey Sequence
Survey sequence represents the order in which surveys should be completed. For example, when a respondent receives surveys with the sequence values 1 and 2, they must complete the survey with a sequence value of 1 before the survey with a sequence value of 2. Additionally, the following parameters apply to survey sequence:
- You can apply the same sequence value to multiple surveys.
- The sequence value must be greater than 0 and less than or equal to 1000. You can enter up to four decimal places.
- You can leave the field empty if the survey doesn’t have to be completed in a certain order.
- Survey sequence is only available when editing a survey with a schedule.
- Survey sequence is not available if one or more schedules for this survey has an available type of “asNeeded”.
Uploading Images to Surveys
You can upload .JPG, .PNG, or .GIF images to display in a survey. Images you upload are saved to the survey’s image library. Survey images adapt to the size of a respondent’s device. Images can be used in the following contexts:
- Above license text
- Above question or instruction heading text
- Above numeric rating scales
- As answers to single- or multiple-choice questions
To upload an image, complete the following steps:
- When creating or editing a survey, select the Add Image icon (
) above the Survey Configuration field.
- Drag-and-drop an image or select Browse to select a file from your computer. For optimal display, we recommend that images in these contexts have the following dimensions (in pixels):
- License Images: At least 90px height
- Heading Images: At least 600px height
- Numeric Rating Scale Images: At least 2350px width
- Answer Images with Answer Text: At least 300px height
- Answer Images without Answer Text: At least 450px height
- Select Upload.
-
In the Image Library tab, select the Copy URL icon (
) beneath the image. The image’s unique URL is copied to your clipboard, and you can paste it into the survey JSON configuration. For more information on the contexts in which images are displayed, see the following sections:
Configuring Survey Conditions
Conditions show or hide controlled questions based on the response a respondent provides to one or more controlling questions. See Configuring Conditions for more information.
Configuring Scores
Survey scoring is configured within the survey JSON. See Configuring Scores for more information.
Questions of the following types can be used in scoring calculations:
- Single Choice
- Multiple Choice (all selected values will be added up)
- Number Entry (with a single entry)
- Numeric Rating Scale
- Visual Analog Scale
Supported HTML Tags
Surveys can support a variety of HTML tags.
Description | Example HTML Tags | Example Output |
---|---|---|
Bold | <b>This text is displayed in bold</b> <strong>This is another way</strong> |
This text is displayed in bold This is another way |
Italic | <i>This text is displayed in italics</i> <em>This is another way</em> |
This text is displayed in italics This is another way |
Underlined | <u>This text is displayed as underlined</u> |
This text is displayed as underlined |
Paragraphs | <p>Paragraph 1</p> <p>Paragraph 2</p> |
Paragraph 1 Paragraph 2 |
Line Breaks | Line 1<br>Line 2 |
Line 1 Line 2 |
Anchor Link | <a href="https://www.veeva.com/">Veeva website</a> |
The following table shows where various HTML tags can be used.
Content Type | Bold, Italics, Underline | Paragraphs, Break Lines | Anchor Links |
---|---|---|---|
|
Yes | Yes | Yes |
|
Yes | Yes | No |
Previewing a Survey
You can preview a survey from the respondent’s perspective in the survey preview.
To preview a survey, locate the survey you want to preview in the survey library, the Surveys tab, or a survey’s JSON editor and select the Preview Survey icon ().
In the survey preview, you can preview a survey in a different language (if translations have been uploaded) by using the Language drop-down menu. From the Preview Size settings you can control the size of the device by selecting a predetermined device size, entering width and height for a custom device size, or by rotating the device with the Rotate icon ().
While completing surveys in the preview, you can reset the survey to its original state by selecting the Reset button at any time. After submission, scores (if they were configured) will appear at the top of the survey as a Site Staff would see them. Selecting the Edit button allows you to change the responses and re-submit the survey, which can be helpful in validating scoring configuration.
Universal Survey Parameters
All surveys that you configure using JSON have universal parameters, which are described below.
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
Survey Type | "surveyType": "ePRO” |
|
Optional |
Language Override | "languageOverride" : "Patient" |
|
Optional |
Name | "name": "Pain Survey" |
The official name of the survey | Required |
Description | "description": "A survey about a patient's Pain while participating in a clinical trial" |
A description of the survey that is displayed in the survey library in a future release | Optional |
License Text | "licenseText": "©Verteo Biopharma. Pain Survey™ is a trademark of the Verteo Institution of Health." |
|
Optional |
The block’s license image container | "licenseImage": {...} |
The container for the survey license image URL and image description, if applicable | Optional |
The block’s license image URL | "image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyLicenseLogo.jpg" |
The URL of the survey image uploaded by a user | Optional |
The block’s license image description | "description": "Pain Survey License Image" |
|
Optional |
Additional Details | "additionalDetails": "Licensed and reviewed for use in study FEZZIK-07. All rights reserved." |
|
Optional |
Sections Array | "sections": [] |
|
Required |
Section Name | "name": "Section1" |
The section must be assigned a name, which is only used by the system and does not display to respondents. | Required |
Blocks Array | "blocks": [] |
|
Required |
Universal Survey Block Parameters
All blocks in a survey that you configure using JSON have universal parameters, which are described below.
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
Survey block type | "type": "singleChoice" |
Each block in a survey must have a survey block type. See the Available Block Types section below for more information about each type’s unique parameters. | Required |
The survey block’s unique name | "name": "q1" |
Each block in a survey must be assigned a unique name. It only needs to be unique within the survey; you can reuse block names across surveys. | Required |
The survey block’s heading image container | "headingImage": {...} |
The container for the survey heading image URL and image description, if applicable | Optional |
The survey block’s heading image URL | "image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyQ1Text.jpg" |
The URL of the heading image uploaded to MyVeeva Studio | Optional |
The survey block’s heading image description | "description": "Pain Survey Question 1 Image" |
|
Optional |
The block’s heading text | "heading": "How was your mobility today?" |
Each block in a survey must have a heading that contains text that the respondent acknowledges or responds to | Required |
The block’s number | "questionNumber": "1" |
|
Optional |
The survey block’s optional answers container | "optionalAnswers": [{...},{...},...] |
|
Optional |
The survey block’s optional answer name | "name": "q1-notapplicable" |
Each optional answer in a survey must be assigned a unique name. It only needs to be unique within the question; you can reuse optional answer names across questions. | Optional |
The survey block’s optional answer text | "answer": "This question is not applicable to me." |
The text of the optional answer that’s displayed to respondents | Optional |
The survey block’s optional answer score | "score": 0 |
|
Optional |
Conditions | "condition": "condition1" |
|
Optional |
Available Block Types
In the JSON editor, you can configure 9 question types: visual analog scale (VAS), numeric rating scale (NRS), single-choice/verbal rating scale (VRS), multiple-choice, number entry, text entry, date entry, time entry, and datetime entry. You can also configure a text block (instructional text). See below for more information about each block type.
All required parameters must be included in the JSON. Optional parameters can either be included with a value of null, or not included.
Configuring a Visual Analog Scale (VAS) Question Type
The following parameters apply for visual analog scale (VAS) question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "visualScale" |
Indicates that a block is a visual analog scale (VAS) question | Required |
In the "blockSettings" node: | |||
The scale’s minimum value | "minNumber": 0 |
The lowest number on the visual analog scale that a respondent can select | Required |
The scale’s maximum value | "maxNumber": 100 |
The highest number on the visual analog scale that a respondent can select | Required |
The scale’s minimum label | "minLabel": "No Pain" |
|
Optional |
The scale’s maximum label | "maxLabel": "The worst pain you can imagine" |
|
Optional |
The scale’s number frequency | "markNumberInterval": 10 |
|
Optional |
The scale’s mark frequency | "markDisplayInterval": 5 |
|
Optional |
The display option for the respondent’s selection |
|
|
Optional |
Example Visual Analog Scale (VAS) JSON Configuration
The following JSON snippet illustrates the visualScale question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "visualScale",
"name": "q1",
"questionNumber": "1",
"heading": "Please tap on the scale to indicate how your health is TODAY.",
"blockSettings": {
"minNumber": 0,
"maxNumber": 100,
"minLabel": "The worst health you can imagine",
"maxLabel": "The best health you can imagine",
"markDisplayInterval": 10,
"markNumberInterval": 100,
"displayResult": false
}
}
Configuring a Numeric Rating Scale (NRS) Question Type
The following parameters apply for numeric rating scale (NRS) question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "numberScale" |
Indicates that a block is a numeric rating scale (NRS) question type | Required |
In the "blockSettings" node: | |||
The scale’s minimum value | "minNumber": 0 |
The lowest number on the numeric rating scale that a respondent can select | Required |
The scale’s maximum value | "maxNumber": 10 |
The highest number on the numeric rating scale that a respondent can select | Required |
The scale’s image container | "answerImage": {...} |
The container for the numeric rating scale’s image URL and description, if applicable | Optional |
The scale’s image URL | "image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyQ1ScaleImage.jpg" |
The URL of the numeric rating scale image uploaded to MyVeeva Studio | Optional |
The scale’s image description | "description": "A range of emotional faces with an extremely sad face on the far left and an extremely happy face on the far right" |
|
Optional |
The scale’s labels | "customMarks": [ |
|
Optional |
Example Numeric Rating Scale (NRS) JSON Configuration
The following JSON snippet illustrates the numberScale question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "numberScale",
"name": "q2",
"questionNumber": "2",
"heading": "Please select on the scale how much pain you feel today.",
"blockSettings": {
"minNumber": 0,
"maxNumber": 10,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyQ1ScaleImage.jpg",
"description": "A range of emotional faces with an extremely sad face on the far left and an extremely happy face on the far right"
},
"customMarks": [
{
"positions":[0],
"label": "No Pain"
},
{
"positions":[10],
"label": "Extreme Pain"
}
]
}
}
Configuring a Single-Choice/Verbal Rating Scale (VRS) Question Type
The following parameters exist for single-choice/verbal rating scale (VRS) question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "singleChoice" |
Indicates that a block is a single-choice/verbal rating scale (VRS) question type | Required |
In the "blockSettings" node: | |||
The height of the block’s response options |
|
|
Optional |
The display type of the block’s response options |
|
|
Optional (cannot be used for questions that include images as answers) |
In the "answerSet" node: | |||
The block’s answerSet | ["answerSet": {...}] |
The container for the block’s answer set | Required |
Answers | "answers": [{...}, {...}, …] |
|
Required |
Name | "name": "1" |
|
Required |
Answer text | "answer": "I have severe pain" |
The text of a response option that’s displayed to the respondent | Optional (either answer text or an answer image must be provided) |
The answer’s image container | "answerImage": {...} |
The container for the answer image URL and description, if applicable | Optional (either answer text or an answer image must be provided) |
The answer’s image URL | "image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA1Image.jpg" |
The URL of the answer image uploaded to MyVeeva Studio | Optional (either answer text or an answer image must be provided) |
The answer’s image description | "description": "An emotional face showing extreme pain" |
|
Optional |
Example Single-Choice/Verbal Rating Scale (VRS) JSON Configuration
The following JSON snippet illustrates the singleChoice question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "singleChoice",
"name": "q3",
"questionNumber": "3",
"heading": "How is your pain today?",
"answerSet": {
"answers": [
{
"name": "1",
"answer": "",
"score": 0,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA1Image.jpg",
"description": "An emotional face showing no pain"
}
},
{
"name": "2",
"answer": "",
"score": 1,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA2Image.jpg",
"description": "An emotional face showing slight pain"
}
},
{
"name": "3",
"answer": "",
"score": 2,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA3Image.jpg",
"description": "An emotional face showing moderate pain"
}
},
{
"name": "4",
"answer": "",
"score": 3,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA4Image.jpg",
"description": "An emotional face showing severe pain"
}
},
]
}
}
{
"type": "singleChoice",
"name": "q4",
"questionNumber": "4",
"heading": "How much physical activity did you perform today?",
"blockSettings": {
"answerHeight": "constant",
"displayAsDropdown": true
},
"answerSet": {
"answers": [
{
"name": "1",
"answer": "No physical activity",
"score": 10
},
{
"name": "2",
"answer": "Light physical activity",
"score": 20
},
{
"name": "3",
"answer": "Moderate physical activity",
"score": 30
},
{
"name": "4",
"answer": "A large amount of physical activity",
"score": 40
},
]
}
}
Configuring a Multiple-Choice Question Type
The following parameters exist for multiple-choice question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "multipleChoice" |
Indicates that a block is a multiple-choice question type | Required |
In the "blockSettings" node: | |||
The height of the block’s response options |
|
|
Optional |
The display type of the block’s response options |
|
|
Optional |
In the "answerSet" node: | |||
The block’s answerSet | ["answerSet": {...}] |
The container for the block’s answer set | Required |
Answers | "answers": [{...}, {...}, …] |
|
Required |
Name | "name": "q1" |
|
Required |
Answer text | "answer": "Walking" |
The text of a response option that’s displayed to a respondent | Optional (either answer text or an answer image must be provided) |
Score | "score": 1 |
The score this question will receive if this answer is selected | Optional |
The answer’s image container | "answerImage": {...} |
The container for the answer image URL and description, if applicable | Optional (either answer text or an answer image must be provided) |
The answer’s image URL | "image": "https://patients.myveeva.com/>assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA1Image.jpg" |
The URL of the answer image uploaded to MyVeeva Studio | Optional (either answer text or an answer image must be provided) |
The answer’s image description | "description": "A person walking" |
|
Optional |
Example Multiple-Choice JSON Configuration
The following JSON snippet illustrates the multipleChoice question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "multipleChoice",
"name": "q1",
"questionNumber": "1",
"heading": "Select all the over-the-counter pain medications you took this week.",
"blockSettings": {
"answerHeight": "variable"
"displayAsDropdown": true
},
"answerSet": {
"answers": [
{
"name": "q1-1",
"answer": "Acetaminophen",
"score": 8
},
{
"name": "q1-2",
"answer": "Naproxen sodium",
"score": 8
},
{
"name": "q1-3",
"answer": "Aspirin",
"score": 5
},
{
"name": "q1-4",
"answer": "Ibuprofen",
"score": 3
}
]
}
},
{
"type": "multipleChoice",
"name": "q1",
"questionNumber": "1",
"heading": "Which physical activities did you perform today?",
"answerSet": {
"answers": [
{
"name": "q1-1",
"answer": "",
"score": 3,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA1Image.jpg",
"description": "A person walking"
}
},
{
"name": "q1-2",
"answer": "",
"score": 3,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA2Image.jpg",
"description": "A person cooking"
}
},
{
"name": "q1-3",
"answer": "",
"score": 3,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA3Image.jpg",
"description": "A person doing light housekeeping"
}
},
{
"name": "q1-4",
"answer": "",
"score": 3,
"answerImage": {
"image": "https://patients.myveeva.com/assets/epro/12345-bc12-1234-a1f2-1a2e34fd5678/PainSurveyA4Image.jpg",
"description": "A person swimming"
}
}
]
}
}
Configuring a Number Entry Question Type
The following parameters apply for number entry question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "numberEntry" |
Indicate that a block is a number entry question type | Required |
The block’s answerSet | ["answerSet": {...}] |
The container for the block’s answer set | Required |
In the "answerSet" node: | |||
Answers | "answers": [{...}, {...}, …] |
|
Required |
Name | "name": "water" |
|
Required |
Label | "label": "Cups" |
The text label of a number entry field that’s displayed to respondents | Optional (required if there are two answer objects) |
Placeholder | "placeholder": "Number of Cups" |
|
Optional |
Minimum Number | "minNumber": 0 |
|
Required |
Maximum Number | "maxNumber": 20 |
|
Required |
Increment | "increment": 0.5 |
|
Required |
Example Number Entry JSON Configuration
The following JSON snippet illustrates the numberEntry question parameters that are described above. The configuration below is not reviewed or licensed for use in a collection.
{
"type": "numberEntry",
"name": "q1",
"heading": "How long did you exercise today?",
"questionNumber": "1",
"answerSet": {
"answers": [
{
"name": "hr",
"label": "Hours",
"placeholder": "Number of Hours",
"minNumber": 0,
"maxNumber": 24,
"increment": 1
},
{
"name": "min",
"label": "Minutes",
"placeholder": "Number of Minutes",
"minNumber": 0,
"maxNumber": 59,
"increment": 1
}
]
}
}
Configuring a Text Entry Question Type
The following parameters apply for text entry question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "textEntry" |
Indicates that a block is a text entry question type | Required |
In the "blockSettings" node: | |||
Label | "label": "Prescribed Medications" |
The text label of a text entry field that’s displayed to respondents | Optional |
Placeholder | "placeholder": "Enter all medications that are currently prescribed to you. You may exclude over-the-counter medications such as vitamins." |
|
Optional |
The entered text’s maximum character length | "maxLength": 1000 |
The maximum number of characters that a respondent can enter as a response. The maximum value you can enter is 1,500. | Required |
Example Text Entry JSON Configuration
The following JSON snippet illustrates the textEntry question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "textEntry",
"heading": "What medications are you currently prescribed?",
"questionNumber": "1",
"blockSettings":
{
"label": "Prescribed Medications",
"placeholder": "Enter all medications that are currently prescribed to you. You may exclude over-the-counter medications such as vitamins.",
"maxLength": 1000
}
}
Configuring a Date Entry Question Type
A date entry question asks the respondent to respond by entering a date. To create a date entry question, you must configure a minimum and maximum valid date. You can optionally configure a default date that is displayed to respondents in the response field. Minimum, maximum, and default date parameters can be static or dynamic values.
Dynamic values are calculated from the point in time at which the respondent is responding to the question. For example, if the maximum date is dynamic with an offset of 3 days, the latest date in the future that a respondent can enter as a response is 3 days after the current date. If the respondent is responding on October 1, 2022, the latest date they can enter as a response is October 4, 2022.
Date Entry Question Universal Parameters
The following universal parameters apply for date entry question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "date" |
Indicates that a block is a date question type | Required |
The date entry question’s blockSettings container | "blockSettings":{ |
Contains all minimum, maximum, and default value parameters for the date entry question’s configuration | Required |
The following tables describe how to configure the minimum, maximum, and default date parameters for date entry questions. All three parameters that are described below are contained in the blockSettings container that is described above.
Date Entry Question Minimum Value Parameters
Minimum Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The date’s minimum value container | "minValue": {...} |
The container for the date’s minimum value parameters that are described below | Required |
The date’s minimum value type |
|
|
Required |
The date’s static minimum value | "value": "2000-01-01" |
|
Required if the type is static |
The date’s dynamic minimum value offset container |
|
|
Optional (only allowed if the type is dynamic) |
Date Entry Question Maximum Value Parameters
Maximum Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The date’s maximum value container | "maxValue": {...} |
The container for the date’s maximum value parameters that are described below | Required |
The date’s maximum value type |
|
|
Required |
The date’s static maximum value | "value": "2022-12-02" |
|
Required if the type is static |
The date’s dynamic maximum value offset container |
|
|
Optional (only allowed if the type is static) |
Date Entry Question Default Value Parameters
Default Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The block’s default response container |
|
|
Optional |
The block’s default response type |
|
|
Required if the default object exists |
The block’s static default response value | "value": "2022-12-02" |
|
Required if the type is static |
The block’s dynamic default response offset container |
|
|
Optional (only allowed if the type is dynamic) |
Example Date JSON Configuration
The following JSON snippet illustrates the date entry question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "date",
"name": "q1",
"heading": "When was your last injection?",
"questionNumber": "1",
"blockSettings": {
"minValue": {
"type": "static",
"value": "2022-01-01"
},
"maxValue": {
"type": "static",
"value": "2022-12-31"
},
"default": null
}
},
{
"type": "date",
"name": "q2",
"heading": "When was your last dose of the study drug?",
"questionNumber": "2",
"blockSettings": {
"minValue": {
"type": "dynamic",
"offset": {
"value": -1,
"unit": "weeks"
}
},
"maxValue": {
"type": "dynamic",
"value": "null"
},
"default": {
"type": "dynamic",
"offset": {
"value": -1,
"unit": "days"
}
}
},
Configuring a Time Entry Question Type
A time entry question asks the respondent to respond by entering a time. You can optionally configure a minimum and maximum valid time. If you don’t configure a minimum or maximum time, the minimum defaults to 00:00 and the maximum defaults to 23:59, meaning all times are allowed. You can optionally configure a default time that is displayed to respondents in the response field. Minimum, maximum, and default time parameters can be static or dynamic values.
Dynamic values are calculated from the point in time at which the respondent is responding to the survey. For example, if the minimum time is dynamic with an offset of -30 minutes, the earliest time in the past that a respondent can enter as a response is 30 minutes before the current time. If the respondent is responding at 11:00, the earliest time they can enter is 10:30.
Time Entry Question Universal Parameters
The following universal parameters apply for time entry question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "time" |
Indicates that a block is a time question type | Required |
The time entry question’s blockSettings container | "blockSettings": { |
Contains all minimum, maximum, and default value parameters for the time entry question’s configuration | Optional |
The following tables describe how to configure the minimum, maximum, and default time parameters for time entry questions. All three parameters that are described below are contained in the blockSettings container that is described above.
Time Entry Question Minimum Value Parameters
Minimum Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The time’s minimum value container | "minValue": {...} |
|
Optional |
The time’s minimum value type |
|
|
Required if the minValue object exists |
The time’s static minimum value | "value": "00:00" |
|
Required if the type is static |
The time’s dynamic minimum value offset container |
|
|
Optional (only allowed if the type is dynamic) |
Time Entry Question Maximum Value Parameters
Maximum Value Parameters | JSON Code Example | Description | Requiredness |
---|---|---|---|
The time’s maximum value container | "maxValue": {...} |
The container for the time’s maximum value parameters that are described below | Optional |
The time’s maximum value type |
|
|
Required if the maxValue object exists |
The time’s static maximum value | "value": "23:59" |
|
Required if the type is static |
The time’s dynamic maximum value offset container |
|
|
Optional (only allowed if the type is static) |
Time Entry Question Default Value Parameters
Default Value Parameters | JSON Code Example | Description | Requiredness |
---|---|---|---|
The block’s default response container |
|
|
Optional |
The block’s default response type |
|
|
Required if the default object exists |
The block’s static default response value | "value": "12:00" |
|
Required if the type is static |
The block’s dynamic default response offset container |
|
|
Optional (only allowed if the type is dynamic) |
Example Time Entry JSON Configuration
The following JSON snippet illustrates the time entry question parameters that are described above. The configuration below is not reviewed or licensed for use in ePRO collections.
{
"type": "time",
"name": "q1",
"heading": "What time did you wake up today?",
"questionNumber": "1",
"blockSettings": {
"minValue": {
"type": "static",
"value": "00:00"
},
"maxValue": {
"type": "static",
"value": "23:59"
},
"default": {
"type": "static",
"value": "07:00"
}
}
},
{
"type": "time",
"name": "q2",
"heading": "What time was your last injection?",
"questionNumber": "2",
"blockSettings": {
"minValue": {
"type": "dynamic",
"offset": {
"value": -24,
"unit": "hours"
}
},
"maxValue": {
"type": "dynamic",
"offset": null
},
"default": null
}
},
Configuring a Datetime Entry Question Type
A datetime entry question asks the respondent to respond by entering a date and time. To configure a datetime entry question, you must configure a minimum and maximum valid datetime. You can optionally configure a default date, time, or datetime that is displayed to respondents in the response field. Minimum, maximum, and default datetime parameters can be static or dynamic values.
Dynamic values are calculated from the point in time at which the respondent is responding to the survey question. For example, if the minimum datetime is dynamic with an offset of -24 hours, the earliest datetime in the past that a respondent can enter as a response is 24 hours before the current datetime. If the respondent is responding at 11:00 on October 1, 2022, the earliest datetime they can enter is 11:00 on September 30, 2022.
Datetime Entry Question Universal Parameters
The following universal parameters apply for datetime entry question types:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "dateTime" |
Indicates that a block is a datetime question type | Required |
The datetime entry question’s blockSettings container | "blockSettings": { |
Contains all minimum, maximum, and default value parameters for the datetime entry question’s configuration | Required |
The following tables describe how to configure the minimum, maximum, and default datetime parameters for datetime entry questions. All three parameters that are described below are contained in the blockSettings container that is described above
Datetime Entry Question Minimum Value Parameters
Minimum Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The datetime’s minimum value container | "minValue": {...} |
The container for the datetime’s minimum value parameters that are described below | Required |
The datetime’s minimum value type |
|
|
Required |
The datetime’s static minimum value | "value": "2000-01-01T00:00" |
|
Required if the type is static |
The datetime’s dynamic minimum value offset container |
|
|
Optional (only allowed if the type is dynamic) |
Datetime Entry Question Maximum Value Parameters
Maximum Value Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The datetime’s maximum value container | "maxValue": {...} |
The container for the datetime’s maximum value parameters that are described below | Required |
The datetime’s maximum value type |
|
|
Required |
The datetime’s static maximum value |
|
|
Required if the type is static |
The date’s dynamic maximum value offset container |
|
|
Optional (only allowed if the type is dynamic) |
Datetime Entry Question Default Value Parameters
Default Value Parameters | JSON Code Example | Description | Requiredness |
---|---|---|---|
The block’s default response container |
|
|
Optional |
The block’s default response type |
|
|
Required if the default object exists |
The block’s static default response value | "value": "2022-12-31T12:00" |
|
Required if the type is static |
The block’s dynamic default response offset container |
|
|
Optional (only allowed if the type is dynamic) |
Additional Details
If a date unit is used as the offset unit (days, weeks, months, years), the resulting datetime depends on whether the value is a negative or positive number:
- If the offset value is negative, the resulting datetime is 00:00 on the day that’s [value] [units] from the datetime at which the respondent is answering the block.
- Example: The minimum value is dynamic and -1 week. If the respondent is responding at 07:00 on October 20, 2022, the earliest datetime they can enter as a response is 00:00 on October 13, 2022.
- If the offset value is positive, the resulting datetime is 23:59 on the day that’s [value] [units] from the datetime at which the respondent is answering the block.
- Example: The maximum value is dynamic and +3 days. If the respondent is responding at 07:00 on October 20, 2022, the latest datetime they can enter as a response is 23:59 on October 23, 2022.
Example Datetime JSON Configuration
The following JSON snippet illustrates the datetime entry question parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "dateTime",
"name": "q1",
"heading": "When did you last eat a meal?",
"questionNumber": "1",
"blockSettings": {
"minValue": {
"type": "dynamic",
"offset": {
"value": -1,
"unit": "days"
},
"maxValue": {
"type": "dynamic",
"offset": null
},
"default": {
"type": "dynamic",
"offset": null
}
}
}
},
{
"type": "dateTime",
"name": "q2",
"condition": "condition3",
"heading": "When did you last visit your primary care physician?",
"questionNumber": "2",
"blockSettings": {
"minValue": {
"type": "static",
"value": "2022-01-01T00:00"
},
"maxValue": {
"type": "dynamic",
"offset": null
},
"default": {
"type": "dynamic",
"offset": {
"value": -1,
"unit": "months"
}
}
}
Configuring a Text Block
The following parameters exist for text/text blocks:
Parameter | JSON Code Example | Description | Requiredness |
---|---|---|---|
The survey block type | "type": "text" |
Indicates that a block is a text block type | Required |
Heading | "heading": "This survey will ask you about your pain TODAY. Select OK to continue." |
|
Required |
Example Text Block JSON Configuration
The following JSON snippet illustrates the text block parameters that are described above. The configuration below is not reviewed or licensed for use in collections.
{
"type": "text",
"name": "instruction",
"heading": "This survey will ask you about your pain TODAY. Select OK to continue.",
}