Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleClick here to view details...

For participant custom field use = cpr.participant.extensionDetail.attrsMap.variableName
For Visit custom field use = visit.extensionDetail.attrsMap.variableName

For Specimen custom field use = specimen.extensionDetail.attrsMap.variableName

Added the ShowWhen condition in form XML to show field based on another custom field value.

image-20240620-132912.png

Show custom field “Branch Form field1“ only when custom field “Show visit Form“ value = y.

image-20240620-133301.png

When custom field “Show visit Form“ value = n then custom field “Branch Form field1“ is not shown:

image-20240620-133450.png

Use Case 4: Display the fields when the multi-select field includes one or more values.
Expand

Requirement: Display the fields consent_provided_via and consented_by when the multi-select field contact_outcome includes one or both of the following values:

  1. "Patient Consented"

  2. "Sent Consent"

The fields should be visible if: contact_outcome contains either "Patient Consented" OR "Sent Consent", OR both.

Syntax:

<showWhen><![CDATA[contact_outcome && (contact_outcome.indexOf('Patient Consented') >= 0 || contact_outcome.indexOf('Sent Consent') >= 0)]]></showWhen>

XML file:

View file
nameshow_when_form_testing_multi_field.xml

Screenshots:

When no value is selected for contact_outcome field:

image-20250127-080645.pngImage Added

When one value is selected for contact_outcome field:

image-20250127-080714.pngImage Addedimage-20250127-080734.pngImage Added

When more than one value is selected for contact_outcome field:

image-20250127-080802.pngImage Added