Hi,
We have an issue with cascading drop downs within a grid. As there are two sets of drop downs which are dynamically updated within the grid.
However where we have multiple rows, when one drop down is set to the place holder; the related drop down where we set the ri to null will throw the error below
Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error at function a!forEach [line 25]: Error in a!forEach() expression during iteration 3: Expression evaluation error at function a!dropdownField [line 71]: A dropdown component [label=“”] has an invalid value for “value”. All selected values must be present in the choiceValues array, but value was 11 and choiceValues was .
Discussion posts and replies are publicly visible
a!dropdownField( required: true, placeholderLabel: "--- select document type ---", choiceLabels: local!docTypes.description, choiceValues: local!docTypes.commonCodeId, value: if(rule!PRO_TK_IsNull(ri!documentTypeIds), "", index(ri!documentTypeIds, fv!index, "")), saveInto: { if( rule!PRO_TK_IsNull(ri!documentSubtypeIds), {}, a!save(ri!documentSubtypeIds, updatearray(ri!documentSubtypeIds, fv!index, "")) ), a!save(ri!documentTypeIds, updatearray(ri!documentTypeIds, fv!index, save!value)) } ), a!dropdownField( required: true, placeholderLabel: "--- select document subtype ---", choiceLabels: if(or(rule!PRO_TK_IsNull(ri!documentTypeIds), length(ri!documentTypeIds)<fv!index, rule!PRO_TK_IsNull(ri!documentTypeIds[fv!index])), null, local!docSubtypes[wherecontains(ri!documentTypeIds[fv!index], index(local!docSubtypes,"parentId"))].description), choiceValues: if(or(rule!PRO_TK_IsNull(ri!documentTypeIds), length(ri!documentTypeIds)<fv!index, rule!PRO_TK_IsNull(ri!documentTypeIds[fv!index])), null, local!docSubtypes[wherecontains(ri!documentTypeIds[fv!index], index(local!docSubtypes,"parentId"))].commonCodeId), value: if(rule!PRO_TK_IsNull(ri!documentSubtypeIds), "", index(ri!documentSubtypeIds, fv!index, "")), saveInto: a!save(ri!documentSubtypeIds, updatearray(ri!documentSubtypeIds, fv!index, save!value)), disabled: rule!PRO_TK_IsNull(index(ri!documentTypeIds, fv!index, {})) )
Here's the code snippet. The value being set is ri!documentSubtypeIds which is an array of intergers. The issue only arises when the array has three values and the second element is being set. The ri being set is definitely set correctly, however the drop down error persists