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

Reply
  • 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

Children