Retrieving a specific document in PM based on its name

Certified Senior Developer

Hi all,

I'm a bit unfamiliar on how can I search for a document based on its name to send it on an email? right now of course doing it manually works but I was wondering if there is a function that returns the document based on its name or anything similar.

For example, I want to send the document named YI5688 (saved in my appian folder called documents) , my process variable contains the name , but I'm not sure how to "search" for the document. Any thoughts or suggestions?

Thanks in advance!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to Maria

    You don't even need todocument - the "document" object type is just a wrapper for the document ID (which is just an integer) - you can freely typecast from one to the other.  So if you look up your document ID from the DB (by any of a hundred different standard methods), you can just save it into a PV of type "document" and use that for whatever you'd want.  (It could even be a PV of type integer instead, though in your process instance you'd just see the ID instead of the document name etc.)