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
+1
person also asked this
people also asked this
Replies
9 replies
Subscribers
8 subscribers
Views
7340 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
#Document Exist? How do i check if a document exist? document(pv!docid, &qu
rayudua
over 11 years ago
#Document Exist? How do i check if a document exist?
document(pv!docid, "name") Fails if the documetn does not exist. pv!docid has a value 1000. but the document might have been manually deleted etc. It fails and throws an error to user. I would like to check if document exist before using that function
if( docExist(pv!docid), document(pv!docid,"name"), "no document");...
OriginalPostID-80995
OriginalPostID-80995
Discussion posts and replies are publicly visible
0
rayudua
over 11 years ago
I need to use this in SAIL dashbordUI expression.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Rick Bivin
Appian Employee
over 11 years ago
You should be able to use or(isnull(pv!docid), pv!docid="") - isnull() will return true if a document has never been stored to the PV and "" should return true if the document was deleted.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rayudua
over 11 years ago
The scenario is different docid has a value but doc does not exit , might be deleted in the document store.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 11 years ago
hi rayudua, A way of doing is to check physical existence of document using fn!getdocumentlatestversionphysicalurl(pv!docid). (even you can use fn!getdocumentphysicalurl or fn!getdocumentlatestversionphysicalurls) If this returns null, your document doesn't exist physically, which means it is deleted. Hope this solves your problem.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rayudua
over 11 years ago
#sikhivahans
Thanks, This function getdocumentlatestversionphysicalurl() is some from a plugin. its not out of box. can you tell which plugin?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 11 years ago
Physical URL of Documents in Expression Functions..After deploying you will find these functions under 'Custom Document Management Functions'
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 11 years ago
here's the link :
forum.appian.com/.../
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rayudua
over 11 years ago
Thanks. Without the plugin. probably not the best. Will try the plugin as well.
if(search("src",documentlist(todocument(1234)))>0,"EXIST", "DOES NOT EXIST")
Just was playing with other out of box document functions that does not throw errors.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 11 years ago
yup.. Even this approach is good.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel