Versions Compared

Key

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

...

Code Block
"lf_locations": {
        "label": "Locations",
        "question_type": "dynamic_multiple_choice",
        "values": [
          {
            "location": "Field 1"
          },
          {
            "location": "Greenhouse"
          },
          {
            "location": "Field 2"
          },
          {
            "location": "Riparian buffer zone"
          }
        ]
      }, 
 "lf_crops": {
        "label": "Crops",
        "question_type": "dynamic_multiple_choice",
        "values": [
          {
            "crop": "Cosmic crunch (apple)"
          },
          {
            "crop": "Honeycrisp (apple)"
          },
          {
            "crop": "Red delicious (apple)"
          }
        ]
      }     

The survey, when generated would do roughly the following:

  1. Check to see if it had any dynamic content

  2. If so, match the dynamic content labels with the payload - in this case “lf_crops” and “lf_locations”

  3. Populate those survey questions with the dynamic content, or handle any issues with those questions (e.g. missing or malformed content)

Other considerations: SurveyStack would need to define error handling in the case where dynamic inputs are missing or malformed.

...