Hello everyone,
I’m working with an interface grid that is prepopulated with different documents. There's also an "Add New" button that allows users to upload additional documents to the grid.
Requirement:
I’ve read in previous posts that the target attribute on the a!fileUploadField component, when set to a folder, creates a new document in that folder. If set to a document, it’s supposed to replace the existing document by creating a new version.
target
a!fileUploadField
However, I’m encountering issues with this approach. Here’s the code I’m using:
a!fileUploadField( target: if( rule!APN_isEmpty(fv!item.id), tofolder(cons!ABG_DOCUMENTS_FOLDER), local!priparedDocuments[fv!index].appianDocumentId ),
The logic is:
fv!item.id
Here, local!preparedDocuments is a CDT that holds document info, similar to a database representation of documents, and appianDocumentId refers to the document ID in Appian.
local!preparedDocuments
appianDocumentId
What's happening:
1) For newly added documents everything works OK, they appear in folder and can be downloaded
2) However, when I try to replace a pre-existing document, the old document still exists, and the new one doesn’t seem to inherit the folder (its parent is shown as [Not Visible]). As a result, the new document cannot be downloaded.
[Not Visible]
Question:
Why is this happening? Shouldn’t setting the target to the document ID in a!fileUploadField replace the old document with the new one while keeping it in the same folder as the original?
Discussion posts and replies are publicly visible
I just tried and worked fine for me, Only thing which you can check is if the users have edit permission to the folder inside which you have your original file
Hi Kumar,
may I ask you for a code snippet? Thanks.
I have the same code as what you have. I was asking you to check the Folder security in which the original document is stored. I am guessing users would need at least editor access to the folder in which doc is stored and also editor access on the original document