I want to show the contents of a folder on record dashboard so that all the docu

I want to show the contents of a folder on record dashboard so that all the documents in the folder are available as a link.
Tried using getdocumentsfromfolder() but think it doesn't work on SAIL. Please suggest....

OriginalPostID-99359

OriginalPostID-99359

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    That function should return an array of documents ids so you then need to either construct a grid or list of link fields. Look at the a!applyComponents function recipes.
  • 0
    Certified Lead Developer
    That function should return an array of documents ids so you then need to either construct a grid or list of link fields. Look at the a!applyComponents function recipes.
  • I tried various alternatives but in vain. Can you please confirm if the current usage is correct:
    a!linkField(
                        label: "ABC",
                        links: {a!applyComponents(
                        function: fn!a!documentDownloadLink
                        array: 1 + enumerate(length(getdocumentsfromfolder(rf!XXX_fol,true()))))})

    where XXX is the folder from where documents needs to be picked.

    I am getting the following error:
    Invalid function a!linkField (not available as [])
  • 0
    Certified Lead Developer
    What version are you using? a!applyComponents and a!documentDownloadLink are only available in 7.4
    This will work for you:
    a!linkField(
    label: "Documents",
    links: a!applyComponents(
    function: a!documentDownloadLink(
    document: _,
    label: "Download"),
    array: getdocumentsfromfolder(cons!IMAGE_DIR, true)
    )
    )
  • My mistake. I was looking at 7.4 documentation. I have Appian 7.3 with me.
  • 0
    Certified Lead Developer
    Ok, in 7.3 you just need to use the standard apply() function but build your own rule in place of a!documentDownloadLink that builds your URL: http://<SERVER_AND_PORT>/suite/doc/ri!docId
  • Tim, when i tried this i dont get results, what is the _, mean after document: will it loop taking the value for array list
    a!linkField(
                                  label: "Documents",
                                  links: a!applyComponents(
                                  function: a!documentDownloadLink(
                                  document: _,
                                  label: "Download"),
                                  array:rf!generatedDocumentList
                                  )
                        )
  • I just see the word document, but the label: part its no parsing the name. _ does not seem to work in label: but it works in document : _ , when i click it downloads 2 different docs as per the docIds, i want to show the name of the file.
    =a!linkField(
    label: "Documents",
    links: a!applyComponents(
                        function: a!documentDownloadLink(
                                  document: _,
                                  label:document(_,"name")                                        ),
              array: {5262,5258}
    )
                        )