Get Document Id by Document name

Certified Senior Developer

 Can we get the document id by document name ?

Please help

  Discussion posts and replies are publicly visible

Parents
  • Hi Dharsana (dharsanag39)  -

    One way you could do this would be to create a docId-to-name reference table in the relational database.

    • For example, as the documents are created in Appian you could record the docId and the name in a pair of db columns columns in one table.
    • You could then connect the name back to the docId in the DB, and then retrieve the doc in Appian with that Id.

    Accordingly, there are some caveats:

    1. Synchronization between the document name in Appian and the document name in the database must be enforced; if the name changes in Appian and doesn't also change in the database the reference is broken
    2. document names in Appian are not required to be unique (hence a unique document id or docId); if you've got multiple documents with the same name, you'll need to be prepared to process and array of document id's returned from your query.
    3. there are probably more considerations, but that's good for now

    Review documentation on the document() function here.  This function requires a docId to retrieve a document.

Reply Children
No Data