• FEATURES
  • PRICING
  • MARKETPLACE
  • CASE STUDIES
  • BLOG
  • Is it possible to modify the dropdown based on what is entered in another field

    I have been reviewing how to control the input using JSON files.
    https://openspecimen.atlassian.net/wiki/spaces/CAT/pages/101187680/Attribute+types+examples

    I would like to know if the values in the dropdowns can be controlled depending on the values in a field. In other words, can I put IF/THEN logic in the JSON file. For example, I want to change the dropdown values for the specimen type depending on the values in the specimen class field.

         {
           "name": "specimen.type",
           "caption": "Specimen Type",
           "type": "dropdown",
           "optional": true,
           "defaultValue": "Not Specified",
    

    IF (specimen.class == “Tissue”) THEN

           "listSource": {
             "selectProp": "value",
             "displayProp": "value",
             "options": [
               {  "value": "Fresh Tissue" },
               { "value": "Frozen Tissue" },
               { "value": "Fixed Tissue" }
             ]
           }
    

    ELSEIF (specimen.class == “Fluid”) THEN

           "listSource": {
             "selectProp": "value",
             "displayProp": "value",
             "options": [
               {  "value": "Buccal Swab" },
               { "value": "Whole Blood" },
               { "value": "Saliva" }
             ]
           }
    

    ENDIF

          }