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

Certified Senior Developer

Hi Everyone,

We have a editable grid with dropdown fields, second drop down(Evidence category) choice values purely dependent on first dropdown (Therapeutic area) selected value.I have configured the code like this but getting the above error.

Can you please help me 

a!sectionLayout(

                      label: "",

                      contents: {

                        a!gridLayout(

                          label: "",

                          labelPosition: "ABOVE",

                          headerCells: {

                            a!gridLayoutHeaderCell(label: "Therapeutic Area"),

                            a!gridLayoutHeaderCell(label: "Disease State"),

                            a!gridLayoutHeaderCell(label: "Evidence Category"),

                            a!gridLayoutHeaderCell(label: "Evidence Need"),

                            a!gridLayoutHeaderCell(label: "Priority"),

                            a!gridLayoutHeaderCell(label: "IEP Code"),

                            a!gridLayoutHeaderCell(label: "Year"),

                            a!gridLayoutHeaderCell(label: "Remove")

                          },

                          columnConfigs: {

                            a!gridLayoutColumnConfig(),

                            a!gridLayoutColumnConfig(width: "MEDIUM"),

                            a!gridLayoutColumnConfig(width: "MEDIUM"),

                            a!gridLayoutColumnConfig(width: "MEDIUM_PLUS"),

                            a!gridLayoutColumnConfig(),

                            a!gridLayoutColumnConfig(),

                            a!gridLayoutColumnConfig(),

                            a!gridLayoutColumnConfig(width: "ICON")

                          },

                          rows: {

                            a!forEach(

                              ri!insertNewData,

                              a!gridRowLayout(

                                contents: {

                                  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)

                                    },

                                    required: true(),

                                    validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT

                                  ),

                                  a!dropdownField(

                                    label: "Disease State",

                                    placeholder: "---Please Select---",

                                    choiceLabels: index(local!diseaseState, "diseaseState", {}),

                                    choiceValues: index(local!diseaseState, "diseaseStateId", {}),

                                    value: fv!item.diseaseStateId,

                                    saveInto: { fv!item.diseaseStateId },

                                    required: if(

                                      fv!item.therapeuticAreaId = cons!ISR_REF_TAID_ONCOLOGY,

                                      true,

                                      false

                                    ),

                                    validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT,

                                    disabled: if(

                                      fv!item.therapeuticAreaId = cons!ISR_REF_TAID_ONCOLOGY,

                                      false,

                                      true

                                    )

                                  ),

                                  a!textField(

                                    label: "Evidence Category",

                                    labelPosition: "ABOVE",

                                    value: fv!item.evidenceCategory,

                                    placeholder: "Enter the value for Evidence Category",

                                    saveInto: { fv!item.evidenceCategory,  },

                                    required: true(),

                                    characterLimit: cons!ISR_TEXT_LENGTH,

                                    showCharacterCount: true(),

                                    validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT/*validations: if(*/

                                    /*contains(*/

                                    /*tointeger(local!isDataExist),*/

                                    /*tointeger(fv!item.rowNum)*/

                                    /*),*/

                                    /*"A record for this TA/Evidence/Priority/IEP/Year combination already exists.",*/

                                    /*{}*/

                                    /*)*/

                                  ),

                                  a!textField(

                                    label: "Evidence Need",

                                    labelPosition: "ABOVE",

                                    value: fv!item.evidenceNeed,

                                    placeholder: "Enter the value for Evidence Need",

                                    saveInto: { fv!item.evidenceNeed,  },

                                    characterLimit: cons!ISR_PARAGRAPH_LENGTH,

                                    showCharacterCount: true(),

                                    /*required: true(),*/

                                    /*validations: if(*/

                                    /*contains(*/

                                    /*tointeger(local!isDataExist),*/

                                    /*tointeger(fv!item.rowNum)*/

                                    /*),*/

                                    /*"A record for this TA/Evidence/Priority/IEP/Year combination already exists.",*/

                                    /*{}*/

                                    /*)*/

                                  ),

                                  /*a!textField(*/

                                  /*label: "Priority",*/

                                  /*labelPosition: "ABOVE",*/

                                  /*value: fv!item.priority,*/

                                  /*placeholder: "Enter the value for Priority",*/

                                  /*required: true(),*/

                                  /*saveInto: { fv!item.priority },*/

                                  /*validations: if(*/

                                  /*contains(*/

                                  /*tointeger(local!isDataExist),*/

                                  /*tointeger(fv!item.rowNum)*/

                                  /*),*/

                                  /*"A record for this TA/Evidence/Priority/IEP/Year combination already exists.",*/

                                  /*{}*/

                                  /*)*/

                                  /*                                    */

                                  /*),*/

                                  a!dropdownField(

                                    label: "Priority",

                                    placeholder: "---Please Select---",

                                    choiceLabels: local!priority,

                                    choiceValues: local!priority,

                                    value: fv!item.priority,

                                    saveInto: { fv!item.priority },

                                    /*required: true()*/

                                  ),

                                  a!textField(

                                    label: "IEP Code",

                                    labelPosition: "ABOVE",

                                    value: fv!item.IEPCode,

                                    placeholder: "Enter the value for IEP Code",

                                    required: true(),

                                    saveInto: { fv!item.IEPCode },

                                    characterLimit: cons!ISR_TEXT_LENGTH,

                                    showCharacterCount: true(),

                                    validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT/*validations: if(*/

                                    /*contains(*/

                                    /*tointeger(local!isDataExist),*/

                                    /*tointeger(fv!item.rowNum)*/

                                    /*),*/

                                    /*"A record for this TA/Evidence/Priority/IEP/Year combination already exists.",*/

                                    /*{}*/

                                    /*)*/

                                  ),

                                  a!textField(

                                    label: "Year",

                                    labelPosition: "ABOVE",

                                    placeholder: "Enter the value for Year",

                                    value: fv!item.year,

                                    /*required: true(),*/

                                    saveInto: { fv!item.year },

                                    /*validations: if(*/

                                    /*contains(*/

                                    /*tointeger(local!isDataExist),*/

                                    /*tointeger(fv!item.rowNum)*/

                                    /*),*/

                                    /*"A record for this TA/Evidence/Priority/IEP/Year combination already exists.",*/

                                    /*{}*/

                                    /*)*/

                                  ),

                                  a!imageField(

                                    images: a!documentImage(

                                      document: a!iconIndicator("REMOVE"),

                                      altText: "Remove Item",

                                      caption: "Remove Condition",

                                      link: a!dynamicLink(

                                        label: "",

                                        value: fv!index,

                                        saveInto: {

                                          a!save(

                                            ri!insertNewData,

                                            remove(ri!insertNewData, fv!index)

                                          )

                                        }

                                      )

                                    ),

                                    size: "ICON"

                                  )

                                }

                              )

                            )

                          },

                          selectionSaveInto: {},

                          addRowLink: a!dynamicLink(

                            label: "Add Row",

                            saveInto: {

                              a!save(

                                ri!insertNewData,

                                append(

                                  ri!insertNewData,

                                  'type!{urn:com:appian:types:IR4ISRA}ISR_v_studyGaps_evidenceCategory'()

                                )

                              )

                            }

                          ),

                          /*validations: {*/

                          /*a!validationMessage(*/

                          /*message: "A record for this TA/Evidence/Priority/IEP/Year combination already exists. Please use Edit IEP Codes to update the values.",*/

                          /*validateAfter: "REFRESH",*/

                          /*showWhen: not(rule!APN_isEmpty(local!isDataExist))*/

                          /*)*/

                          /*},*/

                          shadeAlternateRows: true

                        ),

                        a!buttonLayout(

                          primaryButtons: {

                            a!buttonWidget_23r3(

                              label: "Submit",

                              submit: true,

                              validate: true,

                              disabled: if(

                                a!isNullOrEmpty(ri!insertNewData),

                                true(),

                                or(

                                  a!forEach(

                                    items: ri!insertNewData,

                                    expression: or(

                                      a!isNullOrEmpty(index(fv!item, "therapeuticAreaId", {})),

                                      a!isNullOrEmpty(index(fv!item, "evidenceCategory", {})),

                                      a!isNullOrEmpty(index(fv!item, "IEPCode", {})),

                                      if(

                                        fv!item.therapeuticAreaId = cons!ISR_REF_TAID_ONCOLOGY,

                                        a!isNullOrEmpty(index(fv!item, "diseaseStateId", {})),

                                        {}

                                      )

                                    )

                                  )

                                )

                              ),

                              validationGroup: cons!ISR_VALIDATION_GROUP_SUBMIT,

                              saveInto: {

                                a!save(ri!action, 1),

                                a!startProcess_24r3(

                                  processModel: cons!ISR_PM_ADMIN_IEP_CODES,

                                  processParameters: {

                                    actionFlag: cons!ISR_ADMIN_PORTAL_IEP_CODES_ACTION[2],

                                    /* Text */

                                    insertedEvidenceIEPCdt: ri!insertNewData,

                                    /* List of ISR_v_studyGaps_evidenceCategory */

                                  }

                                )

                              },

                              style: "PRIMARY",

                            )

                          },

                          secondaryButtons: {

                            a!buttonWidget_23r3(

                              label: "Cancel",

                              value: true,

                              saveInto: { ri!cancel, a!save(ri!action, 1) },

                              submit: true,

                              style: "NORMAL",

                              validate: false

                            )

                          }

                        )

                      }

                    )
 
 

  Discussion posts and replies are publicly visible