Skip to main content
tawnal0001
April 11, 2022
Question

Display array values from CDT

  • April 11, 2022
  • 5 replies
  • 0 views

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
)

    5 replies

    stefanhelzle0001
    Brainy
    April 11, 2022

    I suggest to use a!foreach() on that multiple field to dynamically create a list of a!richtextdisplayfield(). In that field, you add a richtextitem to display the text. These can take a link parameter which allows you to download the document using a documentdownloadlink().

    Give it a try.

    peter.lewis
    Employee
    April 11, 2022

    There's also a nice pattern that you can adapt with a list of documents - it's a little more complex, but I like the additional information displayed here: docs.appian.com/.../document-list-pattern.html

    tawnal0001
    April 11, 2022

    Thanks I like the pattern- I'm not very experienced with adjusting local variables- do I replace all of them with ri!record...? I have looked at the "Adapt a Pattern" doc and I'm just clarifying the guidance there. ty