Skip to main content
gabrield295009
October 17, 2024
Solved

how to use the a constant to create a document link?

  • October 17, 2024
  • 11 replies
  • 0 views

Hello,

I am trying to add a document link to an interface. I found the a!documentDownloadLink function and it tells me to create a constant to point to my documents but I am a bit lost.

This is an interface where a supervisor will approve or deny a request so the document link in the form should be attached to the specific request. What do I need to do in the cosntant to point specifically to that value?

The value is store in my recordType as an integer and it is added to the record through an attachment component in a record action. 

any help is appreciated

    Best answer by shubhama926776

    I don't see that constant is required for a!documentDownloadLink()

    If document id stored in DB and document id exist in appian simply use document id from record. use below code to understand more.

    {
      a!linkField(
        label: "Download document",
        labelPosition: "ABOVE",
        links: {
          a!documentDownloadLink(
            label: document(
              documentId:{}, /*Add your document id here from record.*/ 
              property: "name"
            ),
            document: {} /*Add your document id here record.*/
          )
        }
      )
    }

    11 replies

    shubhama926776
    October 17, 2024

    I don't see that constant is required for a!documentDownloadLink()

    If document id stored in DB and document id exist in appian simply use document id from record. use below code to understand more.

    {
      a!linkField(
        label: "Download document",
        labelPosition: "ABOVE",
        links: {
          a!documentDownloadLink(
            label: document(
              documentId:{}, /*Add your document id here from record.*/ 
              property: "name"
            ),
            document: {} /*Add your document id here record.*/
          )
        }
      )
    }
    gabrield295009
    October 17, 2024

    There is a document id and it is store on the DB but the document shown needs to match the current information that is being reviewed. T

    he idea is that someone will have a review request and all the pertinent information will pop up, including the documents attached to that specific request. 

    shubhama926776
    October 17, 2024

    Bit confused.
    Correct me here: You just need to provide the document link for the document whose ID is coming from the database?

    October 17, 2024

    You can create a constant of "Document" type: