Awell Health Developer Hub
Dev Hub

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.

How it works

Rendering a form with Awell

Rendering a form with Awell

Request

Mutation

01

Variables

01

Serialization

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 typeData point value typeValue type to sendExamples
DatedateISO8601 string"2023-01-01"
Numbernumberstring"10"
Short Textstringstring"Awell is great"
Long Textstringstring"A long story about why Awell is so great"
Multiple Choicenumber

string
(value of selected option)

"1"
Multiple Selectnumbers_array

string
(array of values of the selected options)

"[1, 2, 4]"


"['1', '2', '4']"

Slidernumberstring"50"
Yes/Noboolean

string
(we accept different values for booleans)

"true" | "false"
"t" | "f"
"yes" | "no"
"y" | "n"
"1" | "0"

Response

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.

Example

  • A form has 4 questions: Q1, Q2, Q3, and Q4
  • Q1 and Q2 don't have display logic defined
  • Q3 and Q4 do have display logic defined
01

Given the above response, we know that Q1, Q2, and Q3 should be visible and that Q4 needs to be hidden.

Code snippet to get you going

01

How to use