Ideas on creating process for importing excel data to database

Certified Associate Developer

Hi,

I am working on a task where the main function is importing excel data to the database. 
I need to create an interface where I upload the excel file and the file gets saved somewhere in the directory, I did this by simply adding a file upload section which contains this code:

a!sectionLayout(
  label: "Upload Employee File",
  contents: {
    a!fileUploadField(
      label: "File Upload",
      labelPosition: "ABOVE",
      value: ri!document,
      saveInto: ri!document,
      target: cons!HR_EmployeeDataPointer,
      maxSelections: 1
    )
  }
)


Now, I need to create a process model where first I get the data from this uploaded file, query and match the data in the database and check if the employee exists and if it doesn't I need to update the database or leave it as it is if it exists. After these I need to show all the data in a grid in another interface.
Besides the first interface I also created the expression rule to read through the excel file even though it's still not finished yet. It has this code which goes through the uuid field.
if(
  a!isNullOrEmpty(ri!document),
  {},
  a!localVariables(
    local!data: readexcelsheetpaging(ri!document, 0, a!pagingInfo(1, 5000)),
    local!onlyData: index(local!data, "data", null),
    local!employeeData: a!forEach(
      items: local!onlyData,
      expression: 'recordType!{SYSTEM_RECORD_TYPE_USER}User'(
        'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_uuid}uuid': index(fv!item.values, 1, null)
      )
    ),
    local!employeeData
  )
)


Now, some ideas or advice on creating the process model would be helpful because that's where I am kind of stuck

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data