I have a process that gets a Doc ID to be deleted from the database. Before attempting to delete the doc, I would like to check if it exists in Knowledge Center? How can I do so?
See below highlighted node where I need to add this "Check".
Docs to be deleted node returns a list of Documents.
Check needs to search for IDs as an array, if not found, remove from array.
Discussion posts and replies are publicly visible
Can you clarify what you mean by this?
hunterr0001 said:check if it exists in Knowledge Center
Are you saying it should be in some specific knowledge center, and if it isn't in that specific knowledge center, then don't delete it? Or are you merely saying you want to check that it's a valid document ID within Appian? Since all documents are in *some* knowledge center to begin with.
Honestly the best place to do this might be in the code you're using for the "Docs to be Deleted" node - especially if you're handling that output with an expression rule where you can easily test different scenarios.
Thanks for the response.
Docs to be deleted node gets doc Ids from DB and outputs a list of Documents. I would like to check if each document in list is a valid document in Appian and if not, remove it from list.
Check this https://community.appian.com/discussions/f/user-interface/25775/error-when-use-function-document
There are various ways to take a doc ID and check that it represents a valid document in the system - one of the easier current ways that I actually use is the function "isobjectexists()" found in the Check Objects Existence plug-in. I wrap this function in an expression rule that I call something like "APP_Util_docExists()", where i also check that the input ID is non-empty and non-zero before calling the plug-in function on it.
and( a!isNotNullOrEmpty(ri!doc), tointeger(ri!doc) > 0, isobjectexists("Document", ri!doc) )