I have an integration with S3 bucket, which is a type of modify data. This integration pull the documents and store in folder. Now I need to provide a link to user, so that user can click the link and get the documents download. How can I do it in a single click.
Discussion posts and replies are publicly visible
There is no solution I would want to recommend to make this work.
Agreed with Stefan - this sort of thing really requires a 2-click approach to maintain code cleanliness, maintainability, flexibility, etc.
You cannot do it in single click but you can have 2 links
1. Fetch Document - Link to call the integration and bring the documents inside appian using dynamic link
2. Click to Download - Link to download the document using document download link
Step1 : Create a process model to download and store the document in a folder.
Step 2 Create a Post webApi to trigger this process model and this webApi should return the documentId of the downloaded document
Step 3 Create a integration object to trigger this webApi and this should be just returning the documentId again
Step 4 Create a get webApi. In this webApi call the integration object and in response use
a!httpResponse( statusCode: 307, headers: { a!httpHeader(name: "Location", value: local!redirect) } )
where local!redirect : document(documentID,"url").
Step 5 : Call this webApi as a link in your interface.
/* developer.mozilla.org/.../Redirections */ /* In HTTP, redirection is triggered by a server sending a special redirect response to a request. Redirect responses have status codes that start with 3, and a Location header holding the URL to redirect to.When browsers receive a redirect, they immediately load the new URL provided in the Location header.Besides the small performance hit of an additional round-trip, users rarely notice the redirection.*/
Hi Stefan,
My integration is storing document in destination folder and getting document as a result body. As its usage is Modifies data, I can use it in saveInto or Web API. May I know how to use this integration in Web API ?
I tried calling this integration in Web API and used onSuccess parameters using a!save(local!doc,fv!result.body). But it didn't work. Can you please guide me.
If you implement this, make sure to also create a housekeeping process to remove all the temporarily downloaded documents.
Stefan Helzle Could you please help me on the above questions and let me know how to call a integration with modified usage inside Web API because it didn't work for me
This does not work for me either, because Appian does not support it. Did you consider the solution Kumar Agniwesh mentioned below?
Agree, I have a process running to clear the documents overnight