Versions Compared

Key

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

...

You can set fields to show or hide based on values selected in another field using a custom configuration. 

Note

The rules added for skip logic are only reflected on add/edit pages. The overview page is a superset of all fields described in the data dictionary.

Below are some examples of how this feature can be used.

Examples

Show custom field based on the value of another custom field

Show the field 'Relation To Proband' only if the value of field 'Proband' is equal to 'No'.

...

Expand


Code Block
titleExample code
{
  "name" : "specimen.extensionDetail.attrsMap.upload_image",
  "caption" : "Upload image",
  "type" : "file",
  "optional" : true,
  "showInOverviewIf" : "useShowIf",
  "showIf" : {
          "op" : "AND",
          "rules" : [ {
            "field": "specimen.lineage",
            "op": "==",
            "value": "'New'"
          },
          {
            "field" : "specimen.type",
            "op" : "==",
            "value" : "'Whole Blood'"
        } ]
      }
}

The field looks like the below on the specimen overview page:

Show/Hide custom field based on specimen lineage and multiple type condition

Made Method field shows only if the Lineage=Aliquot and Type is RNA or DNA

Code Block
titleExample code
{
      "name" : "specimen.extensionDetail.attrsMap.made_method",
      "caption" : "Made Method",
      "type" : "dropdown",
      "showInOverviewIf": "useShowIf",
        "showIf": {
          "op": "AND",
          "rules": [
            {
              "field": "specimen.lineage",
              "op": "==",
              "value": "'Aliquot'"
            },
            {
              "field" : "specimen.type",
              "op" : ".search('RNA|DNA')!=",
              "value" : "-1"
        }
          ]
        },
      "optional" : true,
      "listSource" : {
        "apiUrl" : "forms/permissible-values",
        "selectProp" : "value",
        "displayProp" : "value",
        "queryParams" : {
          "dynamic" : { },
          "static" : {
            "formName" : "epidemiology_specimen_custom_form",
            "controlName" : "made_method"
          }
        }
      }
    },


Example JSON

Download