I am trying to dynamically populate four drop down fields based on a drop down selection.
example:
1. The user selects a work type from a drop down.
2. The selection is passed to a function which retrieves four lists and stores them in key/value pairs in a map.
3. The map is returned to the form.
4. The keys are pulled and iterated in a 'for...next' loop.
FORM SCRIPT
WorkMap = thisapp.function(input.Work_Required);// this retrieves four lists with the keys set to the Form Field name
WorkMapKeys = WorkMap.keys();
alert WorkMapKeys; // this returns the key names which match the drop down Fields in the Form
for each key in WorkMapKeys
{
clear key;
keyValue = WorkMap.get(key);;
for each value in keyValue
{
key:ui.append(value);
}
}
There is an error that states there is no Field named 'key' in the Form. Why does the script need the static name? What is the workaround to define field names dynamically?
I can do this the long way by iterating each list into the defined dropdown, but it just seems to messy.