How to display multiple files with document link in a single column

Hi,

I have a grid style interface based on process backed record. One of the column(Documents) has multiple files. See the screenshot below:

I'm trying to display download link for the docs listed. I am getting error "Could not display interface. Please check definition and inputs.
Interface Definition: Expression evaluation error at function a!forEach [line 358]: Error in a!forEach() expression during iteration 1: Expression evaluation error at function 'document' [line 361]: The passed parameter(s) are of the wrong type. Received the type List of Document."

Here is the code:

a!gridTextColumn(
            label: "Documents",
            field: "documentAttachmentArray",
            data: if(local!datasubset.totalCount=0,{},a!forEach(items: local!datasubset.data,
                  expression: joinarray(index(fv!item, "documentAttachmentArray", {}),"; "))),
            links: a!forEach(
                   items: local!datasubset.data,
                   expression: joinarray(a!documentDownloadLink(
                              label: document(index(fv!item, "documentAttachmentArray", {}),"name"),
                              document: index(fv!item, "documentAttachmentArray", {})
                ),"; ")
                   )
          )

Any help is appreciated.

Thanks,

Meena

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi Meena,

    If you are using 19.2 version or above, you can use below snippet,

    136627,136626

    {
    a!sectionLayout(
    contents: {
    a!gridField(
    label: "Read-only Grid",
    labelPosition: "ABOVE",
    /* Any data with type data subset, cdt or dictornary can be used*/
    data: {
    documentId: {
    136627,
    136626
    }
    },
    columns: {
    a!gridColumn(
    label: "Documents",
    value: a!richTextDisplayField(
    value: a!forEach(
    {
    136627,
    136626
    },
    {
    a!richTextItem(
    text: document(
    fv!item,
    "name"
    ) & char(
    10
    ),
    link: a!documentDownloadLink(
    document: fv!item
    )
    )
    }
    )
    )
    )
    },
    validations: {}
    )
    }
    )
    }

    ----------------------------------------
    If your Appian version is less than that, then you can editable grid and use a!richtextdisplayfield and have all the rows read-only.

    Thanks

    Subha

Reply
  • 0
    Certified Lead Developer

    Hi Meena,

    If you are using 19.2 version or above, you can use below snippet,

    136627,136626

    {
    a!sectionLayout(
    contents: {
    a!gridField(
    label: "Read-only Grid",
    labelPosition: "ABOVE",
    /* Any data with type data subset, cdt or dictornary can be used*/
    data: {
    documentId: {
    136627,
    136626
    }
    },
    columns: {
    a!gridColumn(
    label: "Documents",
    value: a!richTextDisplayField(
    value: a!forEach(
    {
    136627,
    136626
    },
    {
    a!richTextItem(
    text: document(
    fv!item,
    "name"
    ) & char(
    10
    ),
    link: a!documentDownloadLink(
    document: fv!item
    )
    )
    }
    )
    )
    )
    },
    validations: {}
    )
    }
    )
    }

    ----------------------------------------
    If your Appian version is less than that, then you can editable grid and use a!richtextdisplayfield and have all the rows read-only.

    Thanks

    Subha

Children
No Data