Check if a document exists in Appian

Certified Senior Developer

So I have an interface that has links to documents that have been uploaded. However, the documents don't exist until after they've gone through a process model (or rather they're a temp file that you can't reference at that time). What I'd like to do is disable those links if the documents haven't been put into the system yet, but I am not sure how to check to see if the document exists in the system yet or not. Is there a function or something that can test a doc id to see if it's valid or not?

  Discussion posts and replies are publicly visible

Top Replies

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Naresh

    Quick input:

    a!localVariables(
      local!objectDetails: if(
        a!isNullOrEmpty(ri!objectId),
        "No object with this ID has been found",
        getcontentobjectdetailsbyid(ri!objectId)
      ),
      /*if(
        tostring(local!objectDetails) = "No object with this ID has been found",
        false,
        true
      )
      
      Dont do this kind of "if clause" if you can avoid ;)
      */
      
      tostring(local!objectDetails) <> "No object with this ID has been found",
    )

Children
No Data