Removing deleted docs from a process variable

Hi,
Do you have any idea how to remove all of the documents from a process variable that were previously physically deleted?
The deleted documents in the documents process variable (multiple) are shown as random numbers (for e.q. "85385235"...)
Please help me remove them and leave only the documents that are still valid (not deleted). Using Appian functions (not other plugins/smart services) is preferred.
Thank you in advanced...

OriginalPostID-245303

  Discussion posts and replies are publicly visible

Parents
  • @bojanb I believe something like below should work. I would suggest giving it a try.

    fn!with(
    \t/*where pv!array1 holds the ids of existing and non-existent(or deleted) documents*/
    \tlocal!array1: fn!tointeger(pv!array1),
    \t
    \t/*where pv!array2 holds the ids of existing documents and random numbers because of deleted documents*/
    \tlocal!array2: fn!tointeger(pv!array2),
    \t
    \tlocal!existingDocuments: fn!intersection(local!array1,local!array2),
    \t
    \tlocal!deletedDocumentIds: fn!difference(local!array1,local!existingDocuments),
    \t
    \tconcat("Existing document ids: ",local!existingDocuments,char(13),"Deleted document ids: ",local!deletedDocumentIds)
    )
Reply
  • @bojanb I believe something like below should work. I would suggest giving it a try.

    fn!with(
    \t/*where pv!array1 holds the ids of existing and non-existent(or deleted) documents*/
    \tlocal!array1: fn!tointeger(pv!array1),
    \t
    \t/*where pv!array2 holds the ids of existing documents and random numbers because of deleted documents*/
    \tlocal!array2: fn!tointeger(pv!array2),
    \t
    \tlocal!existingDocuments: fn!intersection(local!array1,local!array2),
    \t
    \tlocal!deletedDocumentIds: fn!difference(local!array1,local!existingDocuments),
    \t
    \tconcat("Existing document ids: ",local!existingDocuments,char(13),"Deleted document ids: ",local!deletedDocumentIds)
    )
Children
No Data