Cannot delete Document ID (containing no document) - Please suggest a way to delete the documentID

Requirement:

We have n number of rows for a file upload column. The requirement is when I upload a file in any of the row, it should get copied to all the rows. and if I want to update any one document, I just delete and upload a new document to the particular row.

Issue:

On submitting the form, the updated (or replaced) document is alone saved in KC. For the documents in other rows, the uploaded documents are not getting saved to KC instead DocumentIDs alone get created. When I attempt to display all these documents in another form, I get an error message saying "The document doesnot exist or may be deleted"


Kindly suggest a way to delete documentID having no document associated with it.

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Senior Developer
    It looks like when you are storing it in the database, you may be storing empty documents. If you are using the write to datastore node in the process model, use an XOR gateway node to check if the document is null before reaching the write to datastore node. The condition should say

    /*if the pv attachments is null*/
    if(isnull(pv!Attachments),
    Go to the node that doesn't write to datastore,
    otherwise, go to the write to datastore node
    )
Reply
  • +1
    Certified Senior Developer
    It looks like when you are storing it in the database, you may be storing empty documents. If you are using the write to datastore node in the process model, use an XOR gateway node to check if the document is null before reaching the write to datastore node. The condition should say

    /*if the pv attachments is null*/
    if(isnull(pv!Attachments),
    Go to the node that doesn't write to datastore,
    otherwise, go to the write to datastore node
    )
Children
No Data