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