Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
4 replies
Subscribers
6 subscribers
Views
3617 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
How do we check before hand if a document exists when we have a ID
raghunandanj3904
Certified Senior Developer
over 7 years ago
Is there a way to find if the document is already in the system, before we use the document() function with the attributes. Suppose we store the DocumentID in DB and while retrieving the document if the document was deleted from the system, how do we make sure the availability of the document in the system. If we use the document function, it will throw error saying document doesn't exist or been deleted and script task gets stuck.
OriginalPostID-233463
Discussion posts and replies are publicly visible
0
sparshs
over 7 years ago
you can create a custom function which will return you simple true or false. In this way you can handle errrors in your code, if the document you are referring is already deleted.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Stefan Helzle
A Score Level 3
over 7 years ago
There is a plugin for this:
forum.appian.com/.../summary
Not sure about the compatibility to latest Appian version, but in my experience this is no big problem. Could also be a good start for own development.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
raghunandanj3904
Certified Senior Developer
over 7 years ago
Thanks Stefan. Will check and try this. We are on 16.2 so need to check on compatibility.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Mike Schmitt
Certified Lead Developer
over 7 years ago
You could instead use the Content Details by UUID plugin, which contains the "getContentObjectDetailsByID()" function. Here's my expression rule:
if(
rule!APN_isBlank(ri!docId),
false(),
trim(
extract(
getcontentobjectdetailsbyid(id: ri!docId),
"Type:",
"]"
)
)
= "Document"
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel