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

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. 

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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

  • 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"
    )
    )
    }
    ))

  • 0
    Certified Lead Developer
    in reply to dhavalp0001

    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.

  • I have data sub set, which has already defined column that I need. How to take same data subset as entity in this field? 

    When I try to take data sub set as entity it throws error.

Reply Children