Hi!
Is there any way to check is exists or not a document in appian,some rule that checks it and return true or false because if i use length or count,it returns me "1" but the document doesnt exist, it´s too weird.
Any help?
Regards,Rebeca
Discussion posts and replies are publicly visible
Hi, Please check the below thread
https://community.appian.com/discussions/f/general/8567/check-weather-document-exists-or-not
I saw this thread but we have not that plugin and we want to find another posibility to check the existence.
Hi Rebecca - what's the context in which you're trying to establish whether a document exists or not? I wonder if you're trying to solve a different problem and have arrived here, when there maybe another way to achieve what you're really trying to achieve?
i have to build a web api, they call it with a query parameter, this parameter is the id, and i need check that this id exists or not like document in Appian repository
Hi rebecar369,
Use this function getcontentobjectdetailsbyid . This function returns "No object with this ID has been found" when there is no document.
Hope this helps!
Hello Rebeca,
Here is a code below you can use in case of document not found.
try( document(todocument(0),"id") ,"Document Not Found")
Thank You
Bibhuti
How does your integration know which document IDs to add as parameters? Do you have an external DB that is storing the ID numbers or, using another integration, or some other method?
What I have often seen in these cases is that you may be able to use some other data to find the associated ID. For example, suppose your Web API is attempting to download documents associated with a case. In this scenario, you could provide the case ID and have Appian query to find documents that correspond to the case. That way, you never have to directly request the document ID; instead, the relationship between your document and the case will find the associated information.
If something like what I described won't work, can you provide a bit more detail on your use case?
Unfortunately, as much as we might see the value in it, Appian still has yet to document the try() function, so it's strongly recommended not to try() anything funny. It could be deprecated, removed, or have it's behavior altered without warning and break any code using it.