Hi Everyone,
We have a editable grid where we placed 2 drop down values. Second dropdown choice values and choice labels purely dependent on first drop down selected value.But we are getting the error.
a!dropdownField( label: "Therapeutic Area", placeholder: "---Please Select---", choiceLabels: index(local!therapeuticArea, "name", {}), choiceValues: index( local!therapeuticArea, "therapeuticAreaId", {} ), value: fv!item.therapeuticAreaId, saveInto: { fv!item.therapeuticAreaId, a!save(fv!item.diseaseStateId, null), a!save(fv!item.studyGap1Id, null()) }, required: true(), validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT ), a!dropdownField( label: "Evidence Category", labelPosition: "ABOVE", value: fv!item.studyGap1Id, choiceValues: index( rule!ISR_qry_GetStudyGap1ById( isActiv: true(), studyGap1Ids: rule!ISR_qry_GetStudyGap1ByTAIds( therapeuticIds: fv!item.therapeuticAreaId, diseaseStateIds: fv!item.diseaseStateId, fetchTotalCount: false() ), columns: { "name", "studyGap1Id" }, returnDataSubset: false() ), "studyGap1Id", {} ), choiceLabels: index( rule!ISR_qry_GetStudyGap1ById( isActiv: true(), studyGap1Ids: rule!ISR_qry_GetStudyGap1ByTAIds( therapeuticIds: fv!item.therapeuticAreaId, diseaseStateIds: fv!item.diseaseStateId, fetchTotalCount: false() ), columns: { "name", "studyGap1Id" }, returnDataSubset: false() ), "name", {} ), placeholder: "-- Please Select the value for Evidence Category", required: true(), disabled: if(fv!item.therapeuticAreaId, false, true), validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT, saveInto: { fv!item.studyGap1Id, a!save( fv!item.studyGap1Name, index( rule!ISR_qry_GetStudyGap1(StudyGap1Id: fv!item.studyGap1Id), "name", null ) ), a!save( fv!item.evidenceCategory, index( rule!ISR_qry_GetStudyGap1(StudyGap1Id: fv!item.studyGap1Id), "name", null ) )/ }, ),
Discussion posts and replies are publicly visible
Hi sireesha looks like your usecase is cascading dropdown You can find example in this interface recipes: Configure Cascading Dropdowns - Appian 25.1
And what error are you facing?
Hi Yashwanth,
I am getting this error:
Could not display interface. Please check definition and inputs.Interface Definition: Expression evaluation error at function a!forEach [line 438]: Error in a!forEach() expression during iteration 3: Expression evaluation error at function a!dropdownField [line 482]: A dropdown component [label="Evidence Category"] has an invalid value for "choiceValues". The choiceLabels and choiceValues arrays must be the same length, but choiceLabels was length 0 and choiceValues was length 67.
sireesha said: but choiceLabels was length 0 and choiceValues was length 67.
The error clearly mentioned where it went wrong, try evaluating your query in second dropdown , check whether it's returning name values are not.