---
category: [Administration & Integrations, Platform and Product Extensions, Platform and Product Extensions/Integration, Administration & Integrations/Custom Integrations & Apps, Platform and Product Extensions/Workday Extend]
keyword: [Extend, Presentation Components, widgets, tags, UI components]
nav: wcp_docs
parent_url: /wcp_docs/
title: attachmentList
layout: subsection
wd_wcptag: attachmentList
---

<a id="section_N10021_N1001E_N10001"></a>
Displays a file attachment that users can preview or download. You can use `attachmentList`:

-   As a standalone widget that displays a file link.
-   As an attachment within a `fileUploader` tag that adds the ability to upload files.


<b>Note:</b> The `attachmentList` widget currently only previews PDF and Microsoft Word documents.

Use `attachmentList` on view and edit pages.

Jump to:

-   [Mobile Support](/wcp_docs/kwi1512515794634.html#section-mobile-support)
-   [Attributes](/wcp_docs/kwi1512515794634.html#section-attributes)


## <a id="section_abg_klk_53b"></a>Usage

## <a id="section_displayingFile"></a>Displaying File Links for Preview or Download

To display a file link, set these attributes:

-   <b>attachmentName</b>

    Specify the saved filename of the file attachment that you're downloading. When the attachment is an Extend attachment object, don't use the `descriptor` as the `attachmentName`. Use the `fileName` of the attachment object instead. Example: `"attachmentName": "<% getData.image.fileName %>"`

-   <b>attachmentURL</b>

    Specify the full URL of the link to the file.

-   <b>attachmentUriTemplate</b>

    Specify `[Target]` to enable the file link.

-   <b>attachmentAuth</b>

    Specify the authentication type required to view the file. The default is `NOAUTH`.

-   <b>instanceList</b>

    Specify only 1 item in `instanceList[]` that contains the mime type, icon, a description, and target link on the description.

    <b>Note:</b> For preview, the `attachmentList` widget currently only supports the `application/pdf` and Microsoft Word document mime types.

    For details, see `instanceList` in the [Attributes](/wcp_docs/kwi1512515794634.html#section-attributes) section.



Example:

```
{
  "type": "attachmentList",
  "id": "attachmentListSimple",
  "label": "Workday Human Capital Management Datasheet",
  "attachmentURL": "https://www.workday.com/content/dam/web/en-us/documents/datasheets/datasheet-workday-human-capital-management.pdf",
  "attachmentName": "workday-hcm-datasheet.pdf",
  "attachmentUriTemplate": "[Target]",
  "instanceList": [
    {
      "action": "attachment",
      "mimeType": "application/pdf",
      "descriptor": "Read the Workday HCM datasheet.",
      "iconId": "mime_pdf"
    }
  ]
 }
```

## <a id="section_downloadingFiles"></a>Uploading Files

Use the `fileUploader` to enable users to upload files with an `attachmentList`:

-   `fileUploaderRow`: On the `fileUploader` widget, displays a linked file on a row.
-   `attachmentList`: Specified as the `attachment` attribute of `fileUploaderRow`. The `attachmentList` uses an `instanceList` that represents the `attachmentURL` file.


This sample `fileUploader` displays a linked PDF file using an `attachmentList`. It also enables users to upload additional files:

```
{
  "type": "fileUploader",
  "id": "fileUploaderWithAttachmentList",
  "label": "Review the document, and upload additional files:",
  "valueOutBinding": "attachFiles",
  "children": [
    {
      "type": "fileUploaderRow",
      "attachment": {
        "type": "attachmentList",
        "attachmentURL": "https://www.workday.com/content/dam/web/en-us/documents/datasheets/datasheet-workday-human-capital-management.pdf",
        "attachmentName": "datasheet-workday-human-capital-management.pdf",
        "attachmentUriTemplate": "[Target]",
        "instanceList": [
          {
            "action": "attachment",
            "descriptor": "Workday Human Capital Management Datasheet",
            "mimeType": "application/pdf",
            "iconId": "mime_pdf"
          }
        ]
      },
      "fileName": "Workday Human Capital Management Datasheet",
      "fileType": "application/pdf",
      "allowRemove": "false"
    }
  ]
}
```

When you use `attachmentList` with `fileUploader`:

-   Only the `label` attribute of `fileUploader` displays.
-   Setting the `render` and `visible` attributes of `attachmentList` to true only hides the clickable descriptor, not the icon.


## <a id="section-mobile-support"></a>Mobile Support

Android, iOS

## <a id="section-attributes"></a>Attributes

-   <b>attachmentAuth</b>

    Data type: binding-String

    The type of authentication the attachment needs. If the attachment doesn't require authentication, specify NOAUTH.

-   <b>attachmentName</b>

    Data type: binding-String

    The saved filename of the downloaded file from the `attachmentURL`.

-   <b>attachmentUriTemplate</b>

    Data type: binding-String

    Enables the link on the attachment name. Set this to `[Target]`.

-   <b>attachmentURL</b>

    Data type: binding-String

    The full URL that links to the file.

-   <b>instanceList</b>

    Data type: `instance` array

    Contains file attributes of an attachment instance. Specify only 1 item in the `instanceList` array with these attributes:

    -   `action`: Specify "`attachment`".
    -   `descriptor`: A file description that displays only when `attachmentList` is a standalone widget (not used with `fileUploader`). You can add a file link on the `descriptor` by specifying the file URL on the `target` attribute.
    -   `mimeType`: The mime type that determines how to open the file. When `attachmentList` can't open the file in preview mode, it downloads the file.

        <b>Note:</b> The `attachmentList` widget currently only previews the `application/pdf` and Microsoft Word document mime types.

        For the list of mime types, see [https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types).

    -   `iconId`: Identifies the icon that `attachmentList` uses to display with the attachment instance. Users can click the icon to open the file. Example: `mime_pdf` for a PDF file.

        Valid values:

        -   mime_plain
        -   mime_java
        -   mime_binary
        -   mime_msexcel
        -   mime_msppt
        -   mime_msword
        -   mime_pdf
        -   mime_post
        -   mime_rtf
        -   mime_zip
        -   mime_wav
        -   mime_image
        -   mime_mpeg
        -   mime_html
        -   mime_etf
        -   mime_xml
        -   mime_avi
        -   mime_qt
        -   mime_msvideo

    -   `target`: The file URL that links the `descriptor` to the file attachment. Set `target` only when `attachmentList` is a standalone widget (not used with `fileUploader`).

-   <b>label</b>

    Data type: dynamicBinding-String

    Text that displays beside or above most widgets. Often used in simple widgets that include inputs.

    The maximum number of characters is 255.

-   <b>render</b>

    Data type: binding-Boolean

    If true, this tag renders as a widget on the page. If false, the loaded page doesn't add this tag or its children. The default is true.

    Unlike the `visible` attribute, when `render` is false, other tags on the page can't reference this tag or widget on edit pages. On view pages, a tag can't reference other tags regardless of the `render` attribute value.

-   <b>sortOrder</b>

    Data type: binding-String

    When you set `sorted` to true on the `section` or `fieldSet` parent of this widget, the `sortOrder` attribute determines the order of this widget within its parent. The sort order is relative to the siblings of the widget.

    Typical values are "a", "b", "c", and so on. Example: The widget with `"sortOrder": "a"` displays before the widget with `"sortOrder": "b"`.

    <b>Note:</b> The `sortOrder` doesn't apply to sorting data on the widget. `sortOrder` only applies to the placement order of the widgets within the parent widget.

-   <b>visible</b>

    Data type: dynamicBinding-Boolean

    If true, the widget generated by this tag is visible. If false, this tag and its children tags aren't visible. This tag provides the ability to display or hide the widget dynamically based on user interactions on the page. The default is true. Unlike the `render` attribute, the generated widget persists on the page even when `visible` is false.

    <b>Notes:</b>

    -   When the widget or field you’re hiding changes on the page, you must include it inside a `fieldSet`.
    -   When the `visible` attribute is false for this widget on an edit page, the outbound endpoint doesn't include the `valueOutBinding` or `valuesOut` data of the widget in the payload. To include the `valueOutBinding` or `valuesOut` data in the payload, use the `onSend` event handler.



