Create a Document Link for Nondisclosure Agreement

 Good Evening I have a question,  I need to provide a link to a document for user to be able to download.. I have read the same few documents and know that the DocumentLinkType is my best option. I also read a few other post and I saw this specific code :

 

a!linkField(
label:"File",
links:{
a!documentdownloadlink(
document:docId
)
}
)

I created and Interface with a Form Layout and within that lay out I have added a section component and a radio dial for users to Agree or Disagree... 

On the section component is where I want to store this document, when I select add component I select links and the add additional component for DocumentLinkType.`

My Issue is that I am so lost as to where I add this information In which Component? I am sure I need some additional logic as well.. Are there directions that show you on which component you should add which code. 

 

  Discussion posts and replies are publicly visible

  • Is the document hosted in Appian or externally?

    If the document is externally hosted, then you can use a safe link and provide the URL to the document. See docs.appian.com/.../Web_Link_Component.html for more information.

    If the document is hosted within Appian you can use the code you have specified. Create a constant of type Document which points to your document that you want users to download, and use the constant as the document value.

    a!linkField(
    links: {
    a!documentDownloadLink(
    label: "Download",
    document: cons!MY_DOCUMENT_CONSTANT,
    )
    }
    )

    You can create this either inside a formLayout or a sectionLayout. Use the graphical Interface Builder as opposed to the code to insert a link field where you want first, and then modify the code to what I have suggested in it's place.
  • Hi ,
    There are multiple ways to to add document in component . I can suggest a way to show document link in a grid.

    a!sectionLayout(
    label: "Doc Attachments",
    firstColumnContents: {

    if(
    rule!APN_isBlank(
    ri!document /* document data type*/
    ),
    {},
    a!gridField(
    totalCount: count(ri!document),
    emptyGridMessage: "No Documents",
    value: a!pagingInfo(
    startIndex: 1,
    batchSize: - 1
    ),
    columns: {
    a!gridTextColumn(
    label: "Document Link",
    data: if(rule!APN_isBlank(
    ri!document
    ),{},a!applyComponents(
    rule!getDocumentName( /* Expression Ruleto display Doc name (provided code below) */
    _,
    1
    ),
    ri!document
    )),
    links: a!applyComponents(
    a!documentDownloadLink(
    _,
    "Document1"
    ),ri!document)
    )
    }
    )
    )


    }
    )
    ***************************************************

    rule!getDocumentName :-
    if(
    rule!APN_isBlank(
    ri!document
    ),
    {},
    document(
    ri!document,
    "name"
    )
    )
    *********************************************************
    Hope this will work for you.
  • This was very helpful.. I was able to get it to work so the form now will download.. so the user can review.