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
5 replies
Subscribers
7 subscribers
Views
2561 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi there, I have a list of document IDs as a list of integers. Now I&
shelzle
over 10 years ago
Hi there,
I have a list of document IDs as a list of integers. Now I'm looking for an idea how to check whether these IDs belong to a valid document. I need a function that does not throw an exception and can be used in a looping function like filter. I already tried todocument, document. These function throw exceptions or return a result even for invalid document IDs....
OriginalPostID-84669
OriginalPostID-84669
Discussion posts and replies are publicly visible
0
Tim
Certified Lead Developer
over 10 years ago
Have you tried the "Physical URL of Documents" expression plugin? I've not been able to test it but if those expressions return a null value then you could assume its an invalid document.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akhilan
over 10 years ago
You can also use the getcontentobjectdetailsbyid() custom function for this. It will return "No object with this ID has been found" if this object id is invalid. It also returns the object name and type if the object id is found. You can use this for checking documents by id. This is a part of the Content Details by UUID plugin on Forum.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 10 years ago
I tried getcontentobjectdetailsbyid. This works, but does return valid results for IDs which do not point to a document (rules, constants, etc). But I think I am able to create a rule to filter out invalid doc IDs using this function.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 10 years ago
This does the job:
=index(split(getcontentobjectdetailsbyid(ri!id), "Type: "), 2, "") = "Document"
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shelzle
over 10 years ago
Thank you very much for your recommendations.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel