Skip to main content
March 14, 2025
Solved

Facing issue with document download link

  • March 14, 2025
  • 4 replies
  • 0 views

I have used the  start process that produces an Excel file and places it in a Folder. when i am trying to download it from UI , it gives nothing.Any 

a!richTextDisplayField(
  value: {
    a!richTextIcon(
      showWhen: if(
        rule!NTD_isNullOrBlank(ri!excelGenerated),
        true,
        false
      ),
      icon: "gears",
      linkStyle: "STANDALONE",
      color: "ACCENT"
    ),
    "  ",
    a!richTextItem(
      showWhen: if(
        rule!NTD_isNullOrBlank(ri!excelGenerated),
        true,
        false
      ),
      text: "Generate Excel",
      linkStyle: "STANDALONE",
      link: a!dynamicLink(
        saveInto: {
          a!startProcess(
            processModel: cons!k_START_PROCESS,
            processParameters: ri!processParameters,
             
              
          
            onSuccess: {
              a!save(
              ri!excelGenerated,
              fv!processInfo.pv.generatedDocument
            ),
            }
          )
        }
      )
    ),
    a!richTextIcon(
      showWhen: if(
        rule!NTD_isNullOrBlank(ri!excelGenerated),
        false,
        true
 ),
      icon: "file-excel-o",
      linkStyle: "STANDALONE",
      
    ),
    "  ",
    a!richTextItem(
      showWhen: if(
        rule!NTD_isNullOrBlank(ri!excelGenerated),
        false,
        true
      ),
      text: "Download Excel",
      linkStyle: "STANDALONE",
      link: a!documentDownloadLink(document:ri!excelGenerated),
    
    )
  },
  align:ri!align
)

    Best answer by mathieud0001

    isSynchronous needs to be true but you must also make sure that your process is chained. Otherwise, you'll need to use a refresh variable to get notified when it is done.

    docs.appian.com/.../recipe-refresh-until-asynchronous-action-completes.html

    4 replies

    yashwantha0914
    March 15, 2025

    Hi [mention:6ca5f0dea8f6464fb2230446ba410f3d:e9ed411860ed4f2ba0265705b8793d05] 

    I attempted your use case; initially, I was unable to download the document from UI as fv!processInfo is returning nothing, then after I read the parameter descriptions of the a!startProcess(),

    I discovered that you must set the isSynchronous parameter to true in order for the fv!processInfo to be accessible.


    After setting the isSynchronous parameter as true, I got the document generated by the process model from the process variable and I'm able to download it.

    Go through following description:

    isSynchronous (Boolean): When true, onSuccess is not evaluated until the child process is complete. If the process is not completed within 30 seconds, onIncomplete is triggered. The child process will continue to run and can complete beyond the timeout.

    onSuccess (Any Type): A list of a!save() or an a!httpResponse() to execute after the smart service executes successfully. When configuring this input, the fv!processInfo function variable (ProcessInfo) is available to specify process properties of the process that was started (such as fv!processInfo.pp.id), properties of the process model (such as fv!processInfo.pm.name), and the values of process variables (such as fv!processInfo.pv.employeeId). fv!processInfo is only available when isSynchronous is true and will otherwise be null. For more information, see Function Variables.

    mathieud0001
    March 16, 2025

    isSynchronous needs to be true but you must also make sure that your process is chained. Otherwise, you'll need to use a refresh variable to get notified when it is done.

    docs.appian.com/.../recipe-refresh-until-asynchronous-action-completes.html

    anitat4764
    March 19, 2025

    I am also facing similar issue. Could you please mention where to set isSynchronous to true