Hi, I have paging grid to show all documents and I want to create a

Hi,

I have paging grid to show all documents and I want to create a link to the document for download. There is a link created but not to the document. Any suggestions on expression so i can get the link to document?
Expression:
a!gridTextColumn(
label: "Name",
field: "appiandocumentid",
data: local!datasubset.data.name,
links:apply(a!documentDownloadLink(document:_), index(local!datasubset.data, "appiandocumentid", {}))
),

OriginalPostID-173948

OriginalPostID-173948

  Discussion posts and replies are publicly visible

Parents
  • I assume you are not storing documentId properly in DB. Doc Id which you get after uploading doc is less than 1 by actual doc ID,
    I mean If you upload a doc and if its appian ID is 2247 , process model gives you 2246, so while saving doc id in DB add '1' to it and save, so retrival will not give error and you'll get document in download link.
    If you have saved correct doc ID and not able to retrive, then use todocument() and check.
    apply(a!documentDownloadLink(document:_), todocument(index(local!datasubset.data, "appiandocumentid", {})))
Reply
  • I assume you are not storing documentId properly in DB. Doc Id which you get after uploading doc is less than 1 by actual doc ID,
    I mean If you upload a doc and if its appian ID is 2247 , process model gives you 2246, so while saving doc id in DB add '1' to it and save, so retrival will not give error and you'll get document in download link.
    If you have saved correct doc ID and not able to retrive, then use todocument() and check.
    apply(a!documentDownloadLink(document:_), todocument(index(local!datasubset.data, "appiandocumentid", {})))
Children
No Data