Hello All,
I have an issue on production. There is an interface which does not open up and throws an error on the screen as below:
Interface Definition: Expression evaluation error at function a!forEach [line 22]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function 'document' [line 24]: Document Does Not Exist or has been Deleted
There are two documents attached to the record and one of them seems to be not present. However, when I tried to search for these documents in the entire environment in the Appian Objects, only one of them is found and the other one is absent. Whenever the attachments are deleted from the interface, the attachment record is marked in the Database as D- "Deleted" and also the interface will always show only the A- "Active" attachment records on the screen.
Now, when I tried to get the object details and print the value in a paragraphfield as below:
a!paragraphField( value:a!forEach(items:local!documentsUploaded.data.documentId, expression: getcontentobjectdetailsbyid(fv!item)) ) There are results returned for both the documents as below: Content Object [Name: Test_Document2, UUID: _a-0000e48d-6f96-8000-9ba6-011c48011c48_1598857, Parent: Temporary Documents Knowledge Center, Parent Id: 7, Type: Document, Created by: test_user1, Created on: 2020-06-16 20:46:41.0, Last updated by: test_user1, Last updated on: 2020-06-16 20:46:42.0, Latest version: 1, State: Invactive Published, Internal file name: N/A]; Content Object [Name: Test_Document2, UUID: _a-0000e48d-6f96-8000-9ba6-011c48011c48_1598874, Parent: Request Upload Files, Parent Id: 36756, Type: Document, Created by: test_user1, Created on: 2020-06-16 20:51:39.0, Last updated by: test_user1, Last updated on: 2020-06-16 20:51:40.0, Latest version: 1, State: Active Published, Internal file name: accdocs1/32029/10154090.pdf] I am a little confused with the state parameter though as above. And when tried to use document() function, it says the first one in the list above does not exist or has been deleted. Also, tried using the function: finddocumentsbyname() to find it in complete directory or root KC as mentioned above "Temporary Documents Knowledge Center", no document found! The overall thing looks very strange since there is no trace of attachments to be deleted. Any pointers regarding this would be appreciated! Thanks in advance!
Discussion posts and replies are publicly visible
The error message is very clear. You're trying to access a Document object in Appian that doesn't exist anymore. If you're keeping the Id of the Document in the database and have marked this as logically deleted (as per your statement:
then you need to filter out any such rows when you query from the database into Appian so you don't even attempt to reference the document in your Appian interface.
Or have I missed something here?
No, the document does'nt seem to be deleted by the user as per the process history. However, our business would be checking about it with the user directly on the same. Also, the Appian code is working fine regarding the deletion logic, the database seems to be updated fine in case of deletion.
Hi, I'm having the exact same issue described in this post. Have you found a solution/reason for what happened to the document and how/why it was made inactive?
A document has suddenly 'disappeared' from our environment causing an error in the interface calling the document ID (taken from the DB) in the document() function:
Expression evaluation error at function 'document' [line 112]: Document Does Not Exist or has been Deleted (APNX-1-4198-000)
I can no longer find the document object anywhere in Appian Designer even after searching by it's UUID. This might make sense if the object has been deleted except the getcontentobjectdetailsbyid() function is still returning the following content:
Content Object [Name: 20220427_141126.jpg, UUID: _a-0000e849-afa9-8000-9be1-011c48011c48_4780488, Parent: Temporary Documents Knowledge Center, Parent Id: 7, Type: Document, Created by: G01386130, Created on: 2022-06-29 16:16:16.0, Last updated by: G01386130, Last updated on: 2022-06-29 16:16:17.0, Latest version: 1, State: Invactive Published, Internal file name: N/A]
As I understand, passing the ID of a deleted document object to this function usually returns 'No object with this ID has been found'.
What does state 'Inactive Published' mean? Also it says the document exists in the 'Temporary Documents KC' but I can't locate it in that folder in Appian Designer and is not where the document was originally saved to.