Validate document ID

Certified Senior Developer

Is there a way to validate an Appian document ID before trying to use the document() function on it?  document() will fail if passed an invalid Appian document, and todocument() will return a document type even if the ID is not a valid Appian document ID

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    What validation are you wanting to do?  Are you talking about a just-uploaded document, or a document ID for a document that may already be in the system if it exists?

    If it's the latter, my favorite way is to use the "getContentObjectDetailsById" function (from the Appian object information retriever plug-in), which will return a string value regardless of how valid the ID you pass in is, but when it belongs to a valid document the metadata it passes out can be used to tell for sure.

Reply
  • 0
    Certified Lead Developer

    What validation are you wanting to do?  Are you talking about a just-uploaded document, or a document ID for a document that may already be in the system if it exists?

    If it's the latter, my favorite way is to use the "getContentObjectDetailsById" function (from the Appian object information retriever plug-in), which will return a string value regardless of how valid the ID you pass in is, but when it belongs to a valid document the metadata it passes out can be used to tell for sure.

Children
No Data