Skip to main content
Participating Frequently
May 10, 2023
Question

Showing excel data to editable grid

  • May 10, 2023
  • 4 replies
  • 0 views

Hi,

I am working on an editable grid which shows excel data. I am fetching excel data from excel using "readexcelsheetpaging()" function. Now i want to map data to editable fields and i tried to do fv!item.fieldName but it is not working.

a!localVariables(
  /*local!studentData:excelreadcellsbyname(ri!excelFile,{1},{"A1","B1","C1"}),*/
  /*local!studentData:excelreadcellsbynumber(ri!excelFile,{1},{1,2,3},{2,3,4,5}),*/
  local!studentData:readexcelsheetpaging(ri!excelFile,0,a!pagingInfo(2,10)),
  local!gridDataType: 'type!{urn:com:appian:SD}SD_Student_Data'(),
a!formLayout(
  label: "Student Details",
  contents: {
    a!sectionLayout(
      contents: {
        a!gridLayout(
          label: "Editable Grid",
          labelPosition: "ABOVE",
          headerCells: {
            /*a!gridLayoutHeaderCell(label: "ID"),*/
            a!gridLayoutHeaderCell(label: "First Name"),
            a!gridLayoutHeaderCell(label: "Last Name"),
            a!gridLayoutHeaderCell(label: "Email Id")
            /*a!gridLayoutHeaderCell(label: "")*/
          },
          columnConfigs: {
            /*a!gridLayoutColumnConfig(width: "ICON"),*/
            a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
            a!gridLayoutColumnConfig(width: "DISTRIBUTE"),
            a!gridLayoutColumnConfig(width: "DISTRIBUTE")
            /*a!gridLayosutColumnConfig(width: "ICON")*/
          },
          rows: {
            a!forEach(
              items: local!studentData,
              expression: a!gridRowLayout(
                contents: {
                  a!textField(
                    value: fv!item.,
                    saveinto: fv!item
                  ),
                  a!textField(
                    value: fv!item,
                    saveinto: fv!item
                  ),
                  a!textField(
                    value: fv!item,
                    saveinto: fv!item
                  ),
                }
              )
            )
          },
          selectionSaveInto: {},
          addRowLink: a!dynamicLink(
            label: "Add Student",
            saveInto: {
              a!save(local!studentData,append(local!studentData,local!gridDataType))
            }
          ),
          validations: {},
          shadeAlternateRows: true
        )
      }
    )
  },
  buttons: a!buttonLayout(
    primaryButtons: {
      a!buttonWidget(
        label: "Submit",
        saveInto: {
          a!startProcessLink(
            processModel: cons!SD_ADDSTUDENTCONST,
            processParameters: {
              
            }
          )
        },
        submit: true,
        style: "PRIMARY"
      )
    },
    secondaryButtons: {
      a!buttonWidget(
        label: "Cancel",
        value: true,
        saveInto: ri!cancel,
        submit: true,
        style: "NORMAL",
        validate: false
      )
    }
  )
)
)

    4 replies

    stefanhelzle0001
    May 10, 2023

    I recommend to have a look at that local variable studentData. I think this is a datasubset holding the actual data in its "data" field. When you change line 30 to reference that field, it should work.

    Participating Frequently
    May 11, 2023

    Thanks! it is working now

    May 11, 2023

    Can you tell me the name of this plug-ins?