Export Excel updated download link

Hello,

I am exporting a table on a button click and I want to give download link for the latest exported excel document.

So when I click on "Generate Excel" button, It should export a table and then update the download link for the latest document.

How can I achieve this on one interface. 

Thanks in advance!

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    I would suggest a button with startProcess in the saveInto which calls a process that generates the excel and returns a docid which you then display in the interface using documentDownload link.

  • 0
    Certified Lead Developer

    Hi Mohini,


    You can achieve your goal by doing something like this, In startprocess process model parameter you have to put your constant which is point to your process model, and processparameters parameter you have to put your document variable. 


    a!localVariables(
      {
        a!richTextDisplayField(
          labelPosition: "COLLAPSED",
          value: {
            a!richTextItem(
              text: "Download document",
              link: a!documentDownloadLink(
                label: "Download document",
                document: ri!document
              ),
              showWhen: a!isNotNullOrEmpty(ri!document)
            )
          }
        ),
        a!buttonArrayLayout(
          buttons: {
            a!buttonWidget(
              showWhen: a!isNullOrEmpty(ri!document),
              label: "Generate Document",
              style: "NORMAL",
              submit: true(),
              saveInto: a!startProcess(
                processModel: cons!SPT_PM_GENERATE_DOCUMENT,
                processParameters: {
                  id:ri!document
                }
              )
            )
          },
          align: "START"
        )
      }
    )
    ,