Free cookie consent management tool by TermsFeed

Document Download Link

On This Page

Function

a!documentDownloadLink( label, document, showWhen )

Defines a link used to download a document. Links can be used in charts, grids, hierarchy browsers, images, link fields, milestones, pickers, and rich text.

See also:

Parameters

Name Keyword Types Description

Label

label

Text

Text displayed as the link name the user clicks on.

Document

document

Any Type

The document to download when the user clicks the link. Provide a document using the document data type or an integer with a document ID. For external documents managed by a record type, provide the entire record.

Show When

showWhen

Boolean

Determines whether the component is displayed on the interface. When set to false, the component is hidden and is not evaluated. Default: true.

Usage considerations

To display a single link or an array of links, use this component inside the Link component.

You can display the document download link in the following places:

Using the document parameter

The way you reference a document in the document parameter depends on how the document is managed—using a record type or folder.

Record type-managed documents:

  • For documents stored in Appian, index into the Document field.

    For example, ri!caseDocument[recordType!Case Document.fields.document], where the rule input points to the Case Document record type.

  • For documents stored in external systems, reference the entire record using a rule input or local variable.

    For example, ri!orderDocument, where the rule input points to the Order Document record type.

Folder-managed documents:

  • Reference the document or document identifier using a constant, query, or other expression.

    For example, ri!documentId, which is a rule input type with a Document data type.

See more examples below.

Examples

To experiment with examples, copy and paste the expression into an interface object.

Record type references are specific to each environment. If you copy and paste an example with a record type or field reference into your interface, it will not evaluate. Use it as a reference only.

Download Appian-stored documents from a record type

This example uses a rule input (ri!caseDocument) to access the specific document to display from the Case Document record type.

This record type manages documents stored in Appian, so the document parameter must reference the document field from the record type.

1
2
3
4
5
6
7
8
9
10
11
12
13
{
  a!linkField(
    label: "Download document",
    labelPosition: "ABOVE",
    links: {
      a!documentDownloadLink(
        label: ri!caseDocument[recordType!Case Document.relationships.documentProperties.fields.name],
        /* References the Document field from the record type */
        document: ri!caseDocument[recordType!Case Document.fields.document]
      )
    }
  )
}

Download externally-stored documents from a record type

This example uses a rule input (ri!orderDocument) to access the specific document to display from the Order Document record type.

This record type manages documents stored in an external system, so the document parameter must reference the entire record.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
  a!linkField(
    label: "Download document",
    labelPosition: "ABOVE",
    links: {
      a!documentDownloadLink(
        label: "Download Document",
        /* References a rule input to the */
        /* Order Document record type */
        document: ri!orderDocument
      )
    }
  )
}

Download Appian-stored documents from a folder

This example uses a rule input (ri!documentId) of type Document to pass a specific document to the interface, and the document() function to display its name.

1
2
3
4
5
6
7
{
  a!documentViewerField(
    label: document(ri!documentId, "name"),
    document: ri!documentId,
    height: "TALL",
  )
}

This example displays a download icon that users can click to download a specific document.

It uses a rule input (ri!invoice) to access the specific document to display from the AT Invoice record type, which manages documents stored in Appian.

1
2
3
4
5
6
7
8
9
10
11
12
13
a!richTextDisplayField(
  value: {
    a!richTextIcon(
      icon: "download",
      caption: ri!invoice[recordType!AT Invoice.relationships.documentProperties.fields.name],
      link: a!documentDownloadLink(
        label: "Document Link",
        /* References the document field from the record type */
        document: ri!invoice[recordType!AT Invoice.fields.document]
      )
    )
  }
)

Feature compatibility

The table below lists this component's compatibility with various features in Appian.
Feature Compatibility Note
Portals Compatible
Offline Interfaces Compatible
Sync-Time Custom Record Fields Incompatible
Real-Time Custom Record Fields Incompatible

Custom record fields that evaluate in real time must be configured using one or more Custom Field functions.

Process Reports Incompatible

Cannot be used to configure a process report.

Process Events Incompatible

Cannot be used to configure a process event node, such as a start event or timer event.

Process Autoscaling Incompatible

Cannot be used in autoscaled processes.

Event Consumer Filter Conditions Compatible

Can be used in filter conditions.

Event Consumer Event Handlers Compatible

Can be used in event handler expressions.

The following recipes include usage of the Document Download Link.

Feedback