Uploading new versions of multiple files

Certified Senior Developer

Hi All,

 

I have a number of files in Appian that are stored in various folders and I also have the Appian DocumentIds for all of them and the mapping between filename and Id.

Furthermore I have a set of newer files on my local PC and what I am aiming to do is replace all of these original files with the newer files (basically create a new version for each of the original files). 

Another thing to mention is that the original file names will differ from the new file names as well as duplicate names being present so a name match will not be suitable. Hence I will be linking original files with new files by Original File DocumentId.

One way to do this would be to manually upload the new version for each file in designer (one by one) which is no doubt very time consuming. 

Are there any alternatives to this that can be achieved by a Process Model (e.g. one which takes original DocumentIds) or otherwise?

 

Thanks

  Discussion posts and replies are publicly visible

  • Hello,

    One idea that would probably be faster than manually doing it through designer is to create a simple interface that has a fileUpload field for each documentId you need to replace and place that in a process model. All you would have to do is upload each file on that interface, and when you submit the form, it would replace the files for you.

    The interface could be built in just a few lines similar to these:
    a!forEach(
    items: {1, 2, 3},
    expression: a!fileUploadField(
    label: "Document ID to Replace: " & fv!item,
    value: index(ri!documents, fv!index, null),
    saveInto: a!save(
    ri!documents,
    append(
    ri!documents,
    save!value
    )
    ),
    target: todocument(fv!item),
    maxSelections: 1,
    required: true
    )
    )

    Where {1, 2, 3} are the documentIds you wish to replace. This will save you the trouble of navigating through designer for each individual document and give you the ability to update all of them at once. You would still have to upload each document separately, though.

    I hope this helps out!