Need to get a document or doc ID by UUID or document name

Hi All,

I have a requirement where I need to get a document or document ID by UUID (ideal option), or worse case by document name.  I know this is not possible out of the box.  I have read that there used to be functions in shared components that could accomplish this.  With shared components being deprecated, what plugin could I use for this use case?

Thanks,

Walker

  Discussion posts and replies are publicly visible

Parents
  • There is the content tools plugin https://community.appian.com/b/appmarket/posts/content-tools
    Is there a reason document UUIDs are being stored? If you need to have the same document in multiple environments it's best to use a constant.

  • Hi Danny,

    Thanks for the plugin.  Yes, the reason is that my use case is to query some sort of identifier from the DB, and display an image dynamically in a form.  There could be hundreds and eventually thousands of different images that need to be displayed dynamically.  

    As a follow up question, how can I get the UUID of a newly uploaded document?

  • We recommend storing the document ID in the database and not the UUID. IDs are unique per environment. You can then using the toDocument() function https://docs.appian.com/suite/help/20.2/fnc_conversion_todocument.html to retrieve the document

  • Thank you for the suggestions Danny.  Unfortunately in my use case the recommended approach will likely work as I am in a unique situation where I have no control over the database or data.  The person who controls the data does not want to deal with updating the IDs every time they deploy to a new environment.  

    My detailed use case is as follows.

    1. Allow the user to upload a document to Appian
    2. Store a reference to that document in an external db that I am connected to via a connected system
    3. On a different UI, query the external DB, receive a list of references to the document, and display those documents dynamically.

    The parts I need help with are:

    1. Which reference to use for the document, given a strong preference to not have IDs change between environments.  Currently I am using a decision table to map to UUIDs, so UUIDs seem like a good option if the rest of the requirements can be met with UUID as the document reference.
    2. How to retrieve a reference to a freshly uploaded document so I can write it to the external DB.  

    Any guidance on questions 1 and 2 would be greatly appreciated.

  • If they have to deploy documents, I still recommend a constant per document. What is there use case for deploying documents between environments? If the user is uploading a document, I imagine it will be in their production environment where the ID will remain constant

  • Danny, that is a good point.  The reason is that while the client is imagining a future state where the user will have the ability to add images to be used dynamically on forms at some point, my team is in a position where we will need to maintain a list of these images manually for some time before the user has the ability to upload themselves. It would make that easier to manage if we could set it up for one environment, and not have to change the IDs in the DB when deploying.

    If I was to use doc id, what is the best way to retrieve the document id for a newly uploaded document?  I know I have to submit the form first, and retrieve it after submission, but I am not sure how to retrieve it the newly uploaded document.

    Thanks again

  • Have you considered adding some kind of "Admin" page that would allow you to manage the images manually at the beginning? That's often what I've seen in cases like this because you then wouldn't have to do a deployment. Also, I'm not sure how often you expect to need to change these documents, but it will be a lot easier to manage them directly from the production UI rather than doing a deployment each time.

    Like Danny said, I'd recommend avoiding the use of UUID for documents if possible. Granted it would probably work fine, but just seems unecessary.

Reply
  • Have you considered adding some kind of "Admin" page that would allow you to manage the images manually at the beginning? That's often what I've seen in cases like this because you then wouldn't have to do a deployment. Also, I'm not sure how often you expect to need to change these documents, but it will be a lot easier to manage them directly from the production UI rather than doing a deployment each time.

    Like Danny said, I'd recommend avoiding the use of UUID for documents if possible. Granted it would probably work fine, but just seems unecessary.

Children