Editable grid with fileupload field

Certified Senior Developer

Hi,

We have editable grid with file upload field. if we upload multiple documents and remove one row in editable grid. On click of submit , it throws below error

Could not upload “User File (1)”. Reason: The destination folder specified is invalid.

Though rows are removed from editable field. Fileupload field still considerthe values i guess.

How to resolve this?

Please help.

Thanks

  Discussion posts and replies are publicly visible

  • You need to manage the documents, even if they are removed from the user's view.  As the user removes a row, you should track the documents to delete (a good example of this is in QuickApps... look at the AttachmentsGridRow rule).

    Here is a link to the documentation for the file upload component: https://docs.appian.com/suite/help/19.2/File_Upload_Component.html

    • When implementing form cancel behavior via a submission, remember that the uploaded files are moved to the target on submission. If this is undesirable in a cancel scenario, it should be deleted (if target is a folder) or reverted via a new version (if the target is a document) by the process after submission.
  • 0
    Certified Lead Developer

    Removing a row in an editable grid, even setting the local variable storing the uploaded doc ID to null, does not keep the document from attempting to upload to the Appian filesystem when the form is submitted.

    One trick I've done in places where it's inconvenient or impossible to take file management measures as mentioned earlier by Matthew, is to disable the deletion of a row if it contains a newly-uploaded file; the user is instructed instead to clear the file upload box first if they wish to remove the row.  (If you still allow the user to perform a "Cancel" click, though, you would still want to handle any necessary deletions as mentioned above).

    Also I would recommend that if the form is submitted and the documents uploaded, and the user gets back to that form immediately or later in a way that they see the previous rows with added documents, don't just show pre-populated file upload fields -- because in this case, if a user clears the upload box and adds a new document, nothing will happen to the old document (it'll still be "orphaned" and sitting in its original location in your filesystem).  Instead I suggest conditionally showing a document download link (preferably formatted within a Rich Text field) for rows that contain previously-submitted documents.