Skip to main content
July 3, 2023
Solved

a!document link component with a!startprocess link in one click

  • July 3, 2023
  • 8 replies
  • 0 views

Hi everyone, I ran into the following problem: I have a job model that downloads files from an S3 bucket and stores the downloaded documents on a constant in document format. I would like to know if by clicking on the image given by the a!documentimage function from an interface, it is possible to start the process that downloads the file to me and then actually see the download of the file. What I do now is use 2 buttons, one to start the process model to store the document in the constant and another one to download the file from the updated constant into the a!documentimage, but I would like to combine the two and use just one click. Thanks in advance.

Best answer by stefanhelzle0001

I still do not get the point with the constant, but anyway ...

Sorry, I have to support Mathieu's answer. There is no reliable and good way of doing this. I thought you just want to display that document on screen. But streaming a document from another source through Appian directly to the user is a different thing.

8 replies

mathieud0001
Brainy
July 3, 2023

Not possible AFAIK.

I think your best bet is to link directly to S3 which is hopefully accessible via the same SSO mechanism as your Appian instance. Otherwise, you'll have to pre-download the files somehow.

July 4, 2023

Hi sir, unfortunately the direct link from the bucket it's not possible. I've tried to use the getpresignedurlfors3() function from the amazon s3 plug-in, but it doesn't generate the url. Instead the download/upload s3 plug-in works well on process models

stefanhelzle0001
Brainy
July 4, 2023

Sure. The trick is to enable chaining in the started process. Then you can fetch the ID of the downloaded document in the onSuccess parameter.

July 4, 2023

Hi sir, i've tried a solution like this, but it doesn't work because the link must be a scalar and not a list of variant, any suggestions?  

Local!message it's initially defined as cons!GEC_TEST_PROCESS_MODEL and everytime it's uploaded with the run of the process model

a!imageField(
label: "",
labelPosition: "ABOVE",
images: {
a!documentImage(
document: cons!IMAGE_TO_DISPLAY,
caption: "test"
link: {
a!startProcessLink(
processModel: cons!GEC_TEST_PROCESS_MODEL,
bannerMessage: a!save(local!message,cons!GEC_TEST_DOCUMENT)
)
,a!documentDownloadLink(
label: "DOCUMENT TO DOWNLOAD"
document: local!message

)}
)
},
size:"ICON"
),
align: "CENTER",
width: "AUTO"
),

stefanhelzle0001
Brainy
July 4, 2023

First, please clarify what you mean with "start the process that downloads the file to me and then actually see the download of the file".

Then, you cannot add multiple links to the link parameter.

Why do you use a constant to reference the downloaded file? Is there only a single user using this app?

This is a bit of a confusing situation. Please clarify. I do not want to spend my time on trying to guess what you want to do.