Adaptive Form - Dropdown selection create fields with preselected data

kjbrereton

29-06-2017

Hello, hoping someone can help/give some ideas.

I have part of an adaptive form where a dropdown field selection needs to populate 3 other fields, 1 of these fields with multiple selections.

the usecase is:

  • I have 3 lists - "Procedure", "Positives", Negatives"
  • Make multiple selections from "Procedure"
  • Each "Procedure" has multiple predetermined selections from the other lists "Positives" and "Negatives"
  • Selected "Procedure(s)" to populate 2 fields "Positives" and "Negatives" with combined selections from respective lists (overlaps can occur, filter out duplicate selections) (so the data can be collected)
  • Ability to remove selections from "Positives" and "Negatives" before form is submitted (does not modify existing list, just adhoc change)
  • Display the selected "Procedure" with corresponding selections on a Document of Record
  • Capture the data of selected "Procedure" with corresponding selections.

My current attempt is through script:

  • I have 3 lists
  • 'value commit' script - switch
  • each case to 'push' items into 2 different arrays (positiveArray, negativeArray)
  • a function with parameters (inputArray, inputPanel, inputField) to:
    • Filter array for duplicates
    • Clear panel instances
    • Create new instances per number of items in array
    • Populate each field of new instances with contents of the array
  • The 'selections' / lists will be stored as JSON in an external db for easier maintenance
  • Another idea was to load the selections from XML files
  • I have also looked at the Coral UI - Multiple Selection with Preselected Items - I like how this looks, compact and easy to use - however don't know how to use with an adaptive form

Can anyone help with a solution?  Should I be thinking about this a different way?

Many thanks!

Accepted Solutions (0)