Is it possible to create an editable grid which I can use to upload more documen

Is it possible to create an editable grid which I can use to upload more documents and simultaneously download a document? Similar to the one in the Capture.JPG uploaded. But the way to download the already uploaded documents.

OriginalPostID-204933

OriginalPostID-204933

  Discussion posts and replies are publicly visible

  • I don't think that's possible. The upload of the files completes until you submit the form. Before that the files are not accessible for download.
  • Hi Sailesh

    Agree to what Eduardo said above. Actually until the form submission, the document is saved on the server with an inactive temporary Id and we cannot perform any operations with that Id. Once the form is submitted, the document is saved with a new version or Id at the target, which we can use for manipulations. One workaround is that we can add a submit button at the bottom of the grid, say 'Upload' button, and on the click of that button just save the document Ids and route the process flow back into the form (make this path activity chained in the process). This time you can show the document download link for each document, either in a new column or in the same column in place of file upload field. Hope it helps!
  • Thanks Eduardo and Shailendra, for the explanation. But is it possible to Download the already uploaded file using the editable grid?
  • Yes, you can do that by using a!documentDownloadLink() component in your grid.

    As I mentioned in my earlier post above, you can show a link for the uploaded files on your editable grid (provided the form has been submitted once, after uploading the files i.e. once you comes back on the form after clicking the 'Upload' button as proposed in the solution above). Until then, show a file upload field in that particular row of the grid, where the document haven't been uploaded yet.

    The idea is to conditionally show a!documentDownloadLink() and a!fileUploadField() component in the grid.
  • Hi we have similar requirement. Can you please share the working code for this?
  • Hi we have similar requirement. Can you please share the working code for this?
  • Hi Ashmita

    As I mentioned above, AFAIK it is not possible to show the document download link for a document unless the form is submitted once because till then the document is saved with a temporary id on the server. You can only show a working document download link for a document once the form on which it has been uploaded has been submitted at-least once.

    Now one working solution could be that you show two different columns in your 'Document' editable grid, one to upload the document and the next to show the document download link for the same document. Show the link in the next column only if you are having valid Document if which you can determine with the help of some logic to derive only those doc ids for which the form have been submitted at least once. So you can do this this way that once you upload a document in one of the rows in grid and submit the form, you will be sending the document through a document type ri! in process. After the user input task activity has been executed, the pv! in the process now holds the legit doc id which you can send back to form while looping back the workflow in the form for some more doc uploads. This time on the grid in the next column you can show the document download link for these legit doc ids next to the respective document upload form. Now this will also tell the user which document has been uploaded and which not.
    You will need to do some additional checks as well
    - Show a blank text box conditionally in the a!gridRowLayout() of grid instead of documnetdownload link(probably with text 'N/A') when no valid doc id is present against a row, in the document link column.
    - As in editable grid user should also be able to delete a document that has been accidentally uploaded in the system, so note the do_ids of such ones and then use delete document smart service in the process model to delete them from the system, upon final submission of the form.