Mutations
Evaluate what question needs to be shown next
This mutation evaluates all conditional logic defined in a form and lets you know which questions (that have display logic) should be visible or hidden.
When working with forms that use conditional logic, you have to call this mutation every time a user answers any question in the form. This guarantees that you will always show the relevant questions only.
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 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"
|
Important to note is that the response of this mutation returns an array of results stating what questions should be visible or hidden based on the configured display logic (=rules).
If a question is always visible because it has no display logic configured, then it won't be included in the response. This means that, by default, questions not included in the response should be visible.
01
Given the above response, we know that Q1, Q2, and Q3 should be visible and that Q4 needs to be hidden.
01