error on Add a Link code in the grid

Hi All,

    am getting the below error when i click on Add New Row Link in to the grid i have created, i have attached my code , please help me whats that am missing.

    error - Interface Definition: Expression evaluation error at function a!forEach [line 327]: Error in a!forEach() expression during iteration 35: Expression evaluation error at function a!dropdownField [line 340]: A dropdown component [label=“”] has an invalid value for “value”. Value cannot be null

Regards

Vineeth

load(
  a!localVariables(
    local!type: cast('type!{urn:com:appian:types:LMP}LMP_REF_TYPES?list',
      rule!LMP_getTypesListByFilters(
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: - 1,
          sort: a!sortInfo(
            field: "abbreviation",
            ascending: true()
          )
        )
      )  
    ),
    local!sbgList: rule!LMP_getSBGDetailsAdmin(
      
    ),
    local!regionList : rule!LMP_getRegionData(
      pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: - 1,
        sort: a!sortInfo(
          field: "abbreviation",
          ascending: true()
        )
      )
    ),
    local!AllValuesMaster: rule!LMP_getAllValuesMasterFilters(
    typeid: ri!typeValueSelected,
      pagingInfo: a!pagingInfo(
      startIndex: 1,
      batchSize: - 1,
      sort: a!sortInfo(
        field: "abbreviation",
        ascending: true()
        )
      )
    ),
    local!SbgSbuMapValues :fn!cast('type!{urn:com:appian:types:LMP}LMP_MAP_SBG_SBU_Master?list', 
      rule!LMP_getSBUDetailsAdmin(   
      )
    ),
    local!SBGFunctionMapValues: rule!LMP_getFunctionSBGMappingDetails(
      
    ),
  
  
a!formLayout(
  label: "Administration",
  contents: {
    
    a!sectionLayout(
      contents: {
        a!dropdownField(
          label: "Master Data",
          labelPosition: "ABOVE",
          placeholderLabel: "--- Select a Value ---",
          choiceLabels: {
            "Type",
            local!type.description    
          },
          choiceValues: {
            0,
            local!type.typeid
          },
          value: ri!typeValueSelected,
          saveInto:ri!typeValueSelected ,
          
          validations: {}
        ),
        a!boxLayout(
          label: if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
          "Type",
          rule!LMP_getTypesListByFilters(
            typeid: ri!typeValueSelected
          ).description),
          showWhen: if(OR(ri!typeValueSelected = 3, ri!typeValueSelected = 10, ri!typeValueSelected = 11),false,true),
          contents: {
            a!gridLayout(
              label: "",
              headerCells: {
                /*a!gridLayoutHeaderCell(*/
                  /*label: "TypeId"*/
                /*),*/
                /*a!gridLayoutHeaderCell(*/
                  /*label: "Abbreviation"*/
                /*),*/
                a!gridLayoutHeaderCell(
                  label: "Name"
                ),
                a!gridLayoutHeaderCell(
                  label: "Active"
                ),
                a!gridLayoutHeaderCell(
                  label: ""
                ),
                a!gridLayoutHeaderCell(
                  label: ""
                )

              },
              columnConfigs: {
                /*a!gridLayoutColumnConfig(*/
                  /*width: "ICON"*/
                /*),*/
                /*a!gridLayoutColumnConfig(),*/
                a!gridLayoutColumnConfig(),
                a!gridLayoutColumnConfig(
                  width: "ICON"
                ),
                a!gridLayoutColumnConfig(
                  width: "ICON"
                ),
                a!gridLayoutColumnConfig(
                  width: "ICON"
                )
              },
              rows: a!forEach(
                items: local!AllValuesMaster,
                expression: a!gridRowLayout(
                  contents: {
                    /*a!textField(*/
                      /*value: fv!item.typeid,*/
                      /*saveInto: fv!item.typeid*/
                    /*),*/
                    /*a!textField(*/
                      /*value: fv!item.abbreviation,*/
                      /*saveInto: fv!item.abbreviation*/
                    /*),*/
                    a!textField(
                      value: fv!item.description,
                      saveinto: fv!item.description
                    ),
                    a!checkboxField(
                      label: "gbe-active",
                      choiceLabels: {
                        ""
                      },
                      choiceValues: {
                        true()
                      },
                      value: if(
                        or(
                          isnull(
                            fv!item.activein
                          ),
                          not(
                            fv!item.activein
                          )
                        ),
                        null,
                        toboolean(
                          fv!item.activein
                        )
                      ),
                      saveInto: {
                        a!save(
                          fv!item.activein,
                          if(
                            isnull(
                              save!value
                            ),
                            false(),
                            save!value
                          )
                        )

                      },
                      align: "CENTER"
                    ),
                    a!imageField(
                      label: "delete " & fv!index,
                      images: a!documentImage(
                        document: a!iconIndicator(
                          "MOVE_UP"
                        ),
                        altText: "Up",
                        caption: "Move Up ",
                        link: a!dynamicLink(
                          value: fv!index,
                          saveInto: {
                            if(
                              fv!index = 1,
                              {},
                              {
                                a!save(
                                  local!AllValuesMaster,
                                  insert(
                                    local!AllValuesMaster,
                                    fv!item,
                                    fv!index - 1
                                  )
                                ),
                                a!save(
                                  local!AllValuesMaster,
                                  remove(
                                    local!AllValuesMaster,
                                    fv!index + 1
                                  )
                                )
                              }
                            )
                          }
                        )
                      ),
                      size: "ICON"
                    ),
                    a!imageField(
                      label: "delete " & fv!index,
                      images: a!documentImage(
                        document: a!iconIndicator(
                          "MOVE_DOWN"
                        ),
                        altText: "Down",
                        caption: "Move Down ",
                        link: a!dynamicLink(
                          value: fv!index,
                          saveInto: {
                            if(
                              fv!index = count(
                                local!AllValuesMaster
                              ),
                              {},
                              {
                                a!save(
                                  local!AllValuesMaster,
                                  insert(
                                    local!AllValuesMaster,
                                    fv!item,
                                    fv!index + 2
                                  )
                                ),
                                a!save(
                                  local!AllValuesMaster,
                                  remove(
                                    local!AllValuesMaster,
                                    fv!index
                                  )
                                )
                              }
                            )
                          }
                        )
                      ),
                      size: "ICON"
                    )
                  }
                )
              ),
              addRowLink: a!dynamicLink(
                label: "Add " & if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
                "Type",
                rule!LMP_getTypesListByFilters(
                  typeid: ri!typeValueSelected
                ).description),
                saveInto: a!save(
                  local!type,
                  append(
                    local!type,
                    'type!{urn:com:appian:types:LMP}LMP_REF_TYPES'(
                      activein:  true()
                    )
                  )
                )
              ),
              shadeAlternateRows: true,
              paginginfo: a!pagingInfo(
                startIndex: 1,
                batchSize: -1,
                sort: a!sortInfo(
                  field: "abbreviation",
                  ascending: true()
                )
              )
            )
            
          }
          
          
          
          ),
          a!boxLayout(
            label: if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
            "Type",
            rule!LMP_getTypesListByFilters(
              typeid: ri!typeValueSelected
            ).description),
            showWhen: if(ri!typeValueSelected = 3,true, false),
            contents: {
              a!gridLayout(
                label: "",
                headerCells: {
                  a!gridLayoutHeaderCell(
                    label: "SBU"
                  ),
                  a!gridLayoutHeaderCell(
                    label: "SBG"
                  ),
                  a!gridLayoutHeaderCell(
                    label: "Active"
                  ),
                  a!gridLayoutHeaderCell(
                    label: ""
                  ),
                  a!gridLayoutHeaderCell(
                    label: ""
                  )

                },
                columnConfigs: {
                  /*a!gridLayoutColumnConfig(*/
                  /*width: "ICON"*/
                  /*),*/
                  /*a!gridLayoutColumnConfig(),*/
                  a!gridLayoutColumnConfig(),
                  a!gridLayoutColumnConfig(),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  ),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  ),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  )
                },
                rows: a!forEach(
                  items: local!SbgSbuMapValues,
                  expression: a!gridRowLayout(
                    contents: {
                      
                      a!textField(
                        value: fv!item.sbudescription,
                        saveinto: fv!item.sbudDescription
                      ),
                      /*a!textField(*/
                        /*value: fv!item.sbgdescription,*/
                        /*saveinto: fv!item.sbgdescription*/
                      /*),*/
                      a!dropdownField(
                        label: "",
                        choiceLabels: {
                          local!sbgList.description    
                        },
                        choiceValues: {
                          local!sbgList.sbgid
                        },
                        value:fv!item.sbgid,
                        saveInto:fv!item.sbgid,
                        validations: {}
                        
                      ),
                      a!checkboxField(
                        label: "gbe-active",
                        choiceLabels: {
                          ""
                        },
                        choiceValues: {
                          true()
                        },
                        value: if(
                          or(
                            isnull(
                              fv!item.activein
                            ),
                            not(
                              fv!item.activein
                            )
                          ),
                          null,
                          toboolean(
                            fv!item.activein
                          )
                        ),
                        saveInto: {
                          a!save(
                            fv!item.activein,
                            if(
                              isnull(
                                save!value
                              ),
                              false(),
                              save!value
                            )
                          )

                        },
                        align: "CENTER"
                      ),
                      a!imageField(
                        label: "delete " & fv!index,
                        images: a!documentImage(
                          document: a!iconIndicator(
                            "MOVE_UP"
                          ),
                          altText: "Up",
                          caption: "Move Up ",
                          link: a!dynamicLink(
                            value: fv!index,
                            saveInto: {
                              if(
                                fv!index = 1,
                                {},
                                {
                                  a!save(
                                    local!SbgSbuMapValues,
                                    insert(
                                      local!SbgSbuMapValues,
                                      fv!item,
                                      fv!index - 1
                                    )
                                  ),
                                  a!save(
                                    local!SbgSbuMapValues,
                                    remove(
                                      local!SbgSbuMapValues,
                                      fv!index + 1
                                    )
                                  )
                                }
                              )
                            }
                          )
                        ),
                        size: "ICON"
                      ),
                      a!imageField(
                        label: "delete " & fv!index,
                        images: a!documentImage(
                          document: a!iconIndicator(
                            "MOVE_DOWN"
                          ),
                          altText: "Down",
                          caption: "Move Down ",
                          link: a!dynamicLink(
                            value: fv!index,
                            saveInto: {
                              if(
                                fv!index = count(
                                  local!SbgSbuMapValues
                                ),
                                {},
                                {
                                  a!save(
                                    local!SbgSbuMapValues,
                                    insert(
                                      local!SbgSbuMapValues,
                                      fv!item,
                                      fv!index + 2
                                    )
                                  ),
                                  a!save(
                                    local!SbgSbuMapValues,
                                    remove(
                                      local!SbgSbuMapValues,
                                      fv!index
                                    )
                                  )
                                }
                              )
                            }
                          )
                        ),
                        size: "ICON"
                      )
                    }
                  )
                ),
                addRowLink: a!dynamicLink(
                  label: "Add " & if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
                  "Type",
                  rule!LMP_getTypesListByFilters(
                    typeid: ri!typeValueSelected
                  ).description),
                  saveInto: a!save(
                    local!SbgSbuMapValues,
                    append(
                      local!SbgSbuMapValues,
                      'type!{urn:com:appian:types:LMP}LMP_MAP_SBG_SBU_Master'(
                        activein:  true()
                      )
                    )
                  )
                ),
                shadeAlternateRows: true,
                paginginfo: a!pagingInfo(
                  startIndex: 1,
                  batchSize: -1,
                  sort: a!sortInfo(
                    field: "abbreviation",
                    ascending: true()
                  )
                )
              )

            }



          ),
          a!boxLayout(
            label: if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
            "Type",
            rule!LMP_getTypesListByFilters(
              typeid: ri!typeValueSelected
            ).description),
            showWhen: if(ri!typeValueSelected = 10,true, false),
            contents: {
              a!gridLayout(
                label: "",
                headerCells: {
                  a!gridLayoutHeaderCell(
                    label: "Function"
                  ),
                  a!gridLayoutHeaderCell(
                    label: "SBG"
                  ),
                  a!gridLayoutHeaderCell(
                    label: "Active"
                  ),
                  a!gridLayoutHeaderCell(
                    label: ""
                  ),
                  a!gridLayoutHeaderCell(
                    label: ""
                  )

                },
                columnConfigs: {
                  /*a!gridLayoutColumnConfig(*/
                  /*width: "ICON"*/
                  /*),*/
                  /*a!gridLayoutColumnConfig(),*/
                  a!gridLayoutColumnConfig(),
                  a!gridLayoutColumnConfig(),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  ),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  ),
                  a!gridLayoutColumnConfig(
                    width: "ICON"
                  )
                },
                rows: a!forEach(
                  items: local!SBGFunctionMapValues,
                  expression: a!gridRowLayout(
                    contents: {

                      a!textField(
                        value: fv!item.functiondescription,
                        saveinto: fv!item.functiondescription
                      ),
                      a!dropdownField(
                        label: "",
                        choiceLabels: {
                          local!sbgList.description    
                        },
                        choiceValues: {
                          local!sbgList.sbgid
                        },
                        value:fv!item.sbgid,
                        saveInto:fv!item.sbgdescription,
                        validations: {}

                      ),
                      a!checkboxField(
                        label: "gbe-active",
                        choiceLabels: {
                          ""
                        },
                        choiceValues: {
                          true()
                        },
                        value: if(
                          or(
                            isnull(
                              fv!item.activein
                            ),
                            not(
                              fv!item.activein
                            )
                          ),
                          null,
                          toboolean(
                            fv!item.activein
                          )
                        ),
                        saveInto: {
                          a!save(
                            fv!item.activein,
                            if(
                              isnull(
                                save!value
                              ),
                              false(),
                              save!value
                            )
                          )

                        },
                        align: "CENTER"
                      ),
                      a!imageField(
                        label: "delete " & fv!index,
                        images: a!documentImage(
                          document: a!iconIndicator(
                            "MOVE_UP"
                          ),
                          altText: "Up",
                          caption: "Move Up ",
                          link: a!dynamicLink(
                            value: fv!index,
                            saveInto: {
                              if(
                                fv!index = 1,
                                {},
                                {
                                  a!save(
                                    local!SBGFunctionMapValues,
                                    insert(
                                      local!SBGFunctionMapValues,
                                      fv!item,
                                      fv!index - 1
                                    )
                                  ),
                                  a!save(
                                    local!SBGFunctionMapValues,
                                    remove(
                                      local!SBGFunctionMapValues,
                                      fv!index + 1
                                    )
                                  )
                                }
                              )
                            }
                          )
                        ),
                        size: "ICON"
                      ),
                      a!imageField(
                        label: "delete " & fv!index,
                        images: a!documentImage(
                          document: a!iconIndicator(
                            "MOVE_DOWN"
                          ),
                          altText: "Down",
                          caption: "Move Down ",
                          link: a!dynamicLink(
                            value: fv!index,
                            saveInto: {
                              if(
                                fv!index = count(
                                  local!SBGFunctionMapValues
                                ),
                                {},
                                {
                                  a!save(
                                    local!SBGFunctionMapValues,
                                    insert(
                                      local!SBGFunctionMapValues,
                                      fv!item,
                                      fv!index + 2
                                    )
                                  ),
                                  a!save(
                                    local!SBGFunctionMapValues,
                                    remove(
                                      local!SBGFunctionMapValues,
                                      fv!index
                                    )
                                  )
                                }
                              )
                            }
                          )
                        ),
                        size: "ICON"
                      )
                    }
                  )
                ),
                addRowLink: a!dynamicLink(
                  label: "Add " & if(or(isnull(ri!typeValueSelected),ri!typeValueSelected = 0),
                  "Type",
                  rule!LMP_getTypesListByFilters(
                    typeid: ri!typeValueSelected
                  ).description),
                  saveInto: a!save(
                    local!type,
                    append(
                      local!type,
                      'type!{urn:com:appian:types:LMP}LMP_MAP_SBG_FUNCTION'(
                        activein:  true()
                      )
                    )
                  )
                ),
                shadeAlternateRows: true,
                paginginfo: a!pagingInfo(
                  startIndex: 1,
                  batchSize: -1,
                  sort: a!sortInfo(
                    field: "abbreviation",
                    ascending: true()
                  )
                )
              )

            }



          )
         
        
      }
    )
    
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        submit: true,
        style: "PRIMARY"
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: "Cancel",
        value: true,
        saveInto: ri!cancel,
        submit: true,
        style: "NORMAL",
        validate: false
      )
    }
  )
)
)
)

  Discussion posts and replies are publicly visible