Skip to main content
October 16, 2023
Question

a!documentDownloadLink

  • October 16, 2023
  • 9 replies
  • 0 views

i link: a!documentDownloadLink(document:
fv!item.appianDocId
), 

 used the above two lines to  download  a document but it does not download  , it open a tab with a message error : 

{
"error": "APNX-1-0000-000",
"message": "Invalid Content ID",
"title": "An Error Has Occurred"
}

    9 replies

    harshm4411
    October 16, 2023

    Hey, the format for utilizing the document download link is as follows:


    a!linkField(
    label: "Link",
    labelPosition: "ABOVE",
    links: {
    a!documentDownloadLink(
    label: "Document Link",
    document: 8552    /* document id */
    )
    }
    )

    stefanhelzle0001
    Brainy
    October 16, 2023

    Is that value in appianDocId a valid document id?

    October 16, 2023

    Yes it seems like it's saving the appianDocId in the database correctly 

    stefanhelzle0001
    Brainy
    October 16, 2023

    You just shared this minimal code snippet. I cannot help you much without more context.

    Did you check the actual values in that data you seem to iterate on?

    annap0005
    November 7, 2023

    look like that appianDocId is not exist or deleted.

    Try to search that is in objects with type UUID or ID. Im sure you will not find that.

    November 8, 2023

    It seems the object you are trying to download does not exists in appian. So before passing the documentID to a!documentDownloadLink() function better to check the exitance of document in Appian using following functions:

    isobjectexists returns true if object exists in Appian.

    isobjectexists(
    "Document",
    /*documentID*/
      

    getcontentobjectdetailsbyid will return all the content of the object.

    getcontentobjectdetailsbyid(
    /*documentID*/
    )

     

    November 9, 2023

    a!gridColumn(
    label: "Download Doc",
    value: a!richTextDisplayField(
    value: a!richTextIcon(
    icon: "download",
    link: a!documentDownloadLink(
    label: document(
    fv!row['recordType!recordTypeName.fields.documentId'],
    "name"
    ),
    document: todocument(
    fv!row['recordType!recordTypeName.fields.documentId']
    )
    )
    ),

    ),
    align: "CENTER",
    width: "1X"
    )

    Hi , try to check with the above code