Queries
Get the form response from a given form activity
Two queries are available for form-related data:
formResponse
: Get the form response from a given form activity.formActivityDataPoints
: Get data points from a form activity with their qualified keys.Query:
01
Note: The label
field will be empty (null) for non-multi-choice questions; for multi-choice questions, it represents the text description of the selected option, pairing its value with a descriptive label. The order of labels in the array matches the values order in the value
field.
Variables:
01
Deserialization:
In the table below you can find an overview of all question types, their corresponding data point value type, and examples of the values you will receive from the Awell API in this query.
Note that we undertake some conversion (particularly for boolean and numbers array value types) to ensure consistency in our system, regardless of the submitted value format.
Question type | Data point value type | Value type you will receive | Examples |
---|---|---|---|
Date | DATE | ISO-8601 String | "2024-03-05T00:00:00.000Z" |
Number | NUMBER | string | "10" |
Short Text | STRING | string | "Awell is great" |
Long Text | STRING | string | "A long story about why Awell is so great" |
Multiple Choice | NUMBER | string
| "1" |
Multiple Select | NUMBERS_ARRAY | string | "[1, 2, 4]" (note: we convert any array of strings submitted to a stringified array of numbers) |
Slider | NUMBER | string | "50" |
Yes/No | BOOLEAN | string | "1" (yes) | "0" (no) (note: we convert all forms of yes/no values in submission mutation to "1" or "0") |
Inputs:
Field | Required | Description | Type |
---|---|---|---|
pathway_id | Yes | the id of the care flow | string |
activity_id | Yes | the id of the form activity (note: not the form id) | string |
Retrieve data points from a form activity with their qualified keys. This query enriches the data points with their qualified keys from the data point definitions, making it easier to identify and use the data points in your application.
Query:
01
Variables:
01
Inputs:
Field | Required | Description | Type |
---|---|---|---|
careflow_id | Yes | the id of the care flow | string |
activity_id | Yes | the id of the form activity | string |
Response fields:
Field | Description | Type |
---|---|---|
key | The qualified key of the data point (e.g., "patient.age") | string |
value | The value of the data point | string |
valueType | The type of the data point value (STRING, NUMBER, BOOLEAN, DATE, NUMBERS_ARRAY) | DataPointValueType |