Display array values from CDT

GM: Just learning Appian as a business analyst. I have a basic app built, one CDT integer field as a array for documents, with the subsequent Appian-generated table for the "many" if the user loads more than one document. How do I display the list of documents for a particular record from that array field? I'd also like to use a link field so another user can download one of the documents if needed.

I've seen the editable grid pattern from other developers but I was hoping for a simpler solution since I'm still learning, and don't have a coding background?? thx in advance

Current code for single document but doesn't work for multiple:

a!textField(
label: "Revised/additional documents",
labelPosition: "ADJACENT",
value: if(rule!APN_isEmpty(ri!record['recordType!Saving.fields.{folderId}folderId']),"-",document(ri!record['recordType!{Saving.fields.{folderId}folderId'],"name")&"."&document(ri!record['recordType!{Saving.fields.{folderId}folderId'],"extension")
),
readOnly: true
)

  Discussion posts and replies are publicly visible

Parents Reply
  • Ah yeah I just realized that pattern doesn't pull data from documents - it actually has hardcoded data. You could use the document() function to find all of the properties that are displayed in that card, but it's a little tricky actually getting the data to show in the right format.

    If you want, you could try to plug in something like this expression to replace the current definition for local!documents and it should work:

    local!documents: a!forEach(
      items: rv!record['recordType!Saving.fields.{folderId}folderId'],
      expression: a!map(
        name: document(fv!item, "name"),
        description: document(fv!item, "description"),
        uploadDate: datetext(document(fv!item, "dateCreated"), "MMMM d"),
        size: document(fv!item, "size")/1000 & "KB",
        type: a!localVariables(
          local!extension: document(fv!item, "extension"),
          a!match(
            value: local!extension,
            whenTrue: contains({"xls", "xslx"}, fv!value),
            then: "excel",
            whenTrue: contains({"doc","docx"}, fv!value),
            then: "word",
            equals:  "pdf",
            then: "pdf",
            default: "image"
          )
        )
      )
    )

    This will loop acroos the list of documents and identifiy properties for each document.

Children