Reference

Advanced data collection

This extension allows you to collect data from your users using a variety of advanced input types and data sources.

This extension allows you to collect data from your users using a variety of advanced input types and data sources.

Category: Forms. Adds 3 actions to a care flow.

Actions

Advanced data collection adds these 3 actions to a care flow. Add one to a step, then fill in its inputs.

Array fields test

Just to show string and numeric array fields

This action can be previewed in Studio before you publish.

InputTypeRequiredDescription
String Arraystring_arrayYesSelect a data point or enter comma separated strings. One of: One, Two, Three.
Numeric Arraynumeric_arrayYesSelect a data point or enter comma separated numbers. One of: One, Two, Three.
String Arraystring_arrayYesSelect a data point or enter comma separated strings. One of: Option 1, Option 2.
Numeric Arraynumeric_arrayYesSelect a data point or enter comma separated numbers. One of: Option 1, Option 2.

Returns:

Data pointType
allNumbersnumbers_array
allStringsstrings_array

Collect medication

Collect medication from the user

InputTypeRequiredDescription
LabelstringNoA label or description that will be shown above the question

Returns:

Data pointType
medicationDatajson
medicationDataStringstring
prettyMedicationDatastring

This action enables patients to list their medications. They can add multiple medications, providing the name, dosage, and any specific instructions for each one.

Dynamic choice selector

The dynamic choice selector allow you to set up a select question where the available choices are dynamically populated through an API lookup

InputTypeRequiredDescription
Select - LabelstringYesEnter the label text that will be displayed before the selector.
Select - Response required?booleanYesThe user must select an option before continuing.
Options - Endpoint URLstringYesEnter the URL (starting with https://) where the options to display can be fetched. The endpoint must return an array of objects with the following properties: id, label and value.
Options - HeadersjsonNoEnter the headers to send to the options source URL. The headers must be in JSON format.
Options - Search query paramstringNoEnter the key of the free text search query param if the endpoint supports this e.g. search for https://example.com/options?search=foo.

Returns:

Data pointType
labelstring
selectedOptionjson
valuestring

Standard select questions in Awell forms have a discrete set of choices to select from that are defined at the time that the form is created. If the list of choices to present to your responders isn't known at the time the form is being built, or changes often, this action allows you to load choices dynamically from a remote data source.

Dynamically-loaded choices must minimally adhere to the following format in a list form (i.e. an array):

[
  {
    "id": "unique-id-1",
    "label": "Choice label 1",
    "value": "Choice value 1"
  },
  {
    "id": "unique-id-2",
    "label": "Choice label 2",
    "value": "Choice value 2"
  }
]

The id, label, and value fields are required. However, additional fields can be added to the object. Besides the label and value, which are available as distinct data points, the additional data of the selected choice will also be returned as a data point.

Example:

[
  {
    "id": "unique-id-1",
    "label": "Choice label 1",
    "value": "Choice value 1",
    "additionalData": "Additional data",
    "nestedData": {
      "nested": "value"
    }
  }
]

Additionally, you can specify a free text search field (Options - Search query param field) to allow users to search through the choices. This is optional but highly recommended. If not specified, the choices will be fetched on question load and presented in a static list that cannot be filtered.

As an example, using the endpoint https://example.com/choices with a query parameter search (e.g. https://example.com/choices?search=QUERY where QUERY is whatever the user typed into the input), then the API is expected to return the choices based on that match the search term.

We recommend that your search logic returns an alphabetically-sorted list of all options where the lowercase label names contain the lowercase search term.

// Example search logic
const searchTerm = req.query.search
const results = []

options.forEach((option) => {
  if (option.label.toLowerCase().includes(searchTerm.toLowerCase())) {
    results.push({
      label: option.label,
      value: option.value,
      id: option.id,
    })
  }
})

const sortedResults = results.sort((a, b) => a.label.localeCompare(b.label))
res.json(results)

Setup and notes

This extension allows you to collect data from your users using a variety of more advanced input types and data sources.

Extension settings

In order to set up this extension, no settings are required.

Where this page comes from

The settings, actions, inputs, outputs and webhooks above are generated from the extension's own code, at @awell-health/awell-extensions v2.1.159. They match what the platform actually does rather than a description of it.

Field-level detail also appears in Awell Studio when you configure the action. Something wrong or missing? Email support@awellhealth.com.

On this page