Export Data Store Entity To Excel

Certified Senior Developer

Hi,

Please suggest how can i fetch first 100 rows using export data store entity to excel.

In filters input we can use only a!queryFilter and a!queryLogicalExpression.

Thanks

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hi  

    Can you please try this logic it may help you

    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 Excel File",
              saveInto: {
                a!exportDataStoreEntityToExcel(
                  entity: cons!BHNC_DSE_RECRUITMENT,
                  documentName: "Excel Export " & now(),
                  saveInFolder: cons!BM_DOCUMENT_FOLDER,
                  filters: {
                    a!queryFilter(
                      field: "id",
                      operator: "in",
                      value: enumerate(100) + 1
                    )
                  },
                  onSuccess: a!save(local!exportDocId, fv!newDocument),
                  /*This displays an error if there is an issue executing the save*/
                  onError: a!save(
                    local!errorMessage,
                    "Error Exporting File to Excel"
                  )
                )
              }
            )
          ),
          {}
        ),
        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 Excel File",
              document: local!exportDocId
            )
          ),
          a!textField(value: local!errorMessage, readOnly: true)
        )
      }
    )

  • 0
    Certified Senior Developer
    in reply to baji mekala

      Thanks for the reply!! but the sequence of the Id should be different and one more thing suppose if one row or record deleted from database it will not fetch the first 100 records because we are using Id filter. so we need something like paginInfo.

Reply Children