How to restrict uploading of duplicate files in Appian Interface ?

I'm trying to use the file upload functionality in Appian Interface and is there any way I can restrict from uploading the file with the same name which already exists in the db or even if it allows the upload is there a way to over write the existing file with the latest file?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Other than a similar filename (and size in bytes), appian has no particular insight into the contents of any uploaded file, before (or even really after) promotion to the "proper" internal Appian FS.  If it's enough that you disallow upload of files with the same name and size as existing files, then you could potentially stir that into the validations parameter of FileUploadField, though I'd caution that getting the existing name and size properties from any more than a small handfull of extant files in your internal system will get pretty process intensive, pretty quickly. 

    If you share more of the particulars of your use case here we might be able to provide some better, more targeted suggestions.

  • Thanks for your answer Mike.My scenario is that I get a weekly file with a cumulative data from previous weeks with the same name and to make it clear to the user regarding which is the latest file I want to over write the existing cumulative file in the system.(PS:This files are being uploaded by UI Path Bot)

  • +1
    Certified Lead Developer
    in reply to sharmistav0001
    I want to over write the existing cumulative file

    FWIW in Appian there really isn't such a thing as "overwrite" the same way that it works in Windows and other conventional operating systems. In Appian there's no restriction on 2 files with identical names in the same folder (since the primary identifier is the Document ID which is always unique and not changeable from the front-end). 

    The closest thing you have in Appian to "overwriting" is the "new version" functionality, where when adding a document, it can be added as a new version of an existing one (provi1ded the extensions are identical). 

    You might look into implementing this via "new version", though it's not the solution I'd recommend first, honestly.  The first thing I'd suggest is to simply rename incoming documents to add a clear, lexically-sortable date stamp to each one (i.e. an iso 8601 style string like "2022-07-13").  You would then simply store all of these documents separately in the same folder, and do what you need from there.

    Further, if you'd like to give yourself increased power and flexibility when finding particular instances of the file, you could have a process add the Doc ID to a field of a bespoke DB table, in which you write a new row each time you receive a new version of the document - along with a "created" DATETIME column which you populate with the current timestamp upon writing.  In this way you'd always be easily able to grab the latest uploaded document by using the QueryEntity function to grab the latest row and thus the latest Document ID.

  • Thanks for the clear explanation Mike.I would want to try out the new version solution is there any way you can  point me out towards working of that

  • 0
    Certified Lead Developer
    in reply to sharmistav0001

    Whether the "new version" route is even technically possible depends on the method by which you're getting the file in your system - can you describe in a bit more detail how you're doing so?

  • via an Appian Interface using the file upload option!!

Reply Children