Mutations
Submit a completed form response
01
01
Given form responses are polymorphic, the answer value for a question should always be sent as a string. Values are validated and deserialized on the Awell side and we will throw an error if a value does not match the corresponding data point value type.
In the table below you can find an overview of all question types, their corresponding data point value type, and the value type you should be sending to the Awell API.
Question type | Data point value type | Value type to send | Examples |
---|---|---|---|
Date | date | ISO8601 string | "2023-01-01" |
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]" "['1', '2', '4']" |
Slider | number | string | "50" |
Yes/No | boolean | string
| "true" | "false"
|
The optional X-User-ID
header can be used to specify which user is submitting the form response. When this header is present, Awell Orchestration will log a subactivity indicating that this specific user filled in the form.
01
The following input fields are available:
Field | Required | Description | Type |
---|---|---|---|
activity_id | Yes | the id of the form activity | string |
response | Yes | the responses to questions in the form | array of response objects |
response.question_id | Yes, for each response object | the id of the question for this response | string |
response.value | Yes, for each response object | the value of the response, corresponding to the question's data point value type | string |
When submitting a form response, if one or more required questions are left unanswered, the backend will return a GraphQL error. The error response will appear as follows:
01
The extensions
field in the error object will provide details about the missing values. The unanswered questions are listed under extensions.data.data
.