Skip to main content
September 24, 2021
Question

Download all records of dashboard in excel. Dashboard build in interface.

  • September 24, 2021
  • 12 replies
  • 0 views

Download all records of dashboard in excel. Dashboard build in interface.

We can easily download all records through simple tick mark option  in record type but don't know how to do that in interface. 

see attachment

    12 replies

    Participating Frequently
    September 25, 2021

    Hi,

    You can create a link in on the interface and under saveinto, you can call a!exportDataStoreEntityToCsv() to export the tables rows to csv(Very similar to record feature).

    a!localVariables(
      local!exportDocId,
      local!errorMessage,
      {
        if(
          isnull(local!exportDocId),
          /*This link field contains the link that starts the export*/
          a!linkField(
            labelPosition: "COLLAPSED",
            links: a!dynamicLink(
              label: "Export to CSV File",
              saveInto: {
                a!exportDataStoreEntityToCsv(
                  entity: cons!ENTITY,
                  documentName: "CSV Export " & now(),
                  saveInFolder: cons!FOLDER,
                  onSuccess: a!save(
                    local!exportDocId,
                    fv!newDocument
                  ),
                  /*This displays an error if there is an issue executing the the save*/
                  onError: a!save(
                    local!errorMessage,
                    "Error Exporting File to CSV"
                  )
                )
              }
            )
          ),
          {}
        ),
        if(
          /*This only displays the download link if a valid document was created*/
          not(isnull(local!exportDocId)),
          /*This changes the link to a download link for the newly created document */
          a!linkField(
            links: a!documentDownloadLink(
              label: "Download CSV File",
              document: local!exportDocId
            )
          ),
          a!textField(
            value: local!errorMessage,
            readOnly: true
          )
        )
      }
    )

    Thanks

    September 26, 2021

    Thanks for Reply.

    I have tried this but i got error like:

    "Interface Definition: Expression evaluation error: An error occurred while executing a smart service: Unable to export. Maximum number of columns exceeded: 50 (APNX-1-4505-038)"

    Please find why i got this error. My code is:

    a!linkField(
    labelPosition: "COLLAPSED",
    links: a!dynamicLink(
    label: "Export to Excel File",
    saveInto: {
    a!exportDataStoreEntityToExcel(
    entity: cons!CRP_ROBOTIC_PROJECT_DSE,
    documentName: "Excel Export ",
    saveInFolder: cons!FOLDER1,
    onSuccess: a!save(
    local!exportdoc,
    fv!newDocument
    ),
    /*This displays an error if there is an issue executing the the save*/
    onError: a!save(
    local!errorMessage,
    "Error Exporting File to CSV"
    )
    )
    }
    ))

    Participating Frequently
    September 26, 2021

    Hi, You are getting the error as your  data store entity has exceeded the maximum allowed column size which is 50. Make use of selection parameter to only use the columns which are required.