Hi All,
I'm new to Appian and have a requirement where a user should upload multiple documents and delete any accidentally uploaded documents.
On submit, the process model would kick start where the documents details get stored in database. Also,we need to delete the documents if any.
After file upload , Need to get the link to download.
It would be helpful if I get any sample code to refer.
Thanks....
Discussion posts and replies are publicly visible
I'm a little confused by what your requirement / desired process flow is here?
srilakshmit said:a user should upload multiple documents
(simple enough...)
srilakshmit said:and delete any accidentally uploaded documents
what/who is determining which document(s) are considered as "accidentally uploaded"?
srilakshmit said:the process model would kick start where the documents details get stored in database.
(this sounds fine also. should be straightforward to implement.)
srilakshmit said:Also,we need to delete the documents
Why would you delete the documents just after uploading? Am I missing something?
srilakshmit said:After file upload , Need to get the link to download.
FYI there isn't really any "link" to get, really - all you need is the Appian Document ID for each uploaded document (which you get automatically after submitting the original form the document(s) were uploaded on), and a!documentDownloadLink() on an interface. So just make sure your database row for a document includes its Appian Document ID.
So...it's a little unclear in places what you're asking for but I can try to cover all the bases...so:
Hi Mike,
Thanks for clarifying.
What if user upload an incorrect file and submit which gets stored in database. So he needs to upload the file again and delete the older document.
If it's the user that decides an incorrect file was uploaded, that's fine (and a normal use case) -- you would then need to build in the capability in your interface for the user to "delete" the file (i suggest for record-keeping purposes, you not actually delete files except for ones used very temporarily, but instead, move them to a special designated location within Appian's folder structure for "deleted" files, and have a flag in the database table for each document to also indicate its "deleted" status).
The recipe Stewart posted in his earlier reply would only need a small addition to accomplish this - add an extra column at the end of the grid, and configure it to contain a "delete" link (either text, or icon, etc), which could then submit the form, mark that document as "deleted" in the database and move it to the "deleted" folder location (or actually delete it if you are required to), then loop back to the same form again.