Hi,
Does anyone know how to convert a document stored in appian to an url? to use it as a dynamic link in a json.
Thanks!
Discussion posts and replies are publicly visible
Can you tell us a bit more about your use case? I'm unclear what approach you're even going for here. If, for instance, you want to allow a user to download the file from an Appian interface, you'd use the Document ID in a Document Download Link (preferably in a Rich Text Display), wherein they'd be able to click that link and download it. Appian handles the URL creation involved, ther isn't really a way to manually construct such a URL directly.
and there's any way you can save that download url? In case anyone else wants to download the document just with an url, not using the document download link.
Downloads are only available to a logged-in user viewing an active interface. There's no supported way to grab an externally-usable URL for a document download, as Appian requires that downloads are only accessible by users in the proper security roles/groups.
This method is not sanctioned by Appian but it will work if you share it with someone who is authenticated.
a!localVariables( local!documentDownloadLink: a!documentDownloadLink( document: cons!NZC_CSO_IMAGE_DOCUMENT_ID ), local!urlPrefix: "https://<APPIAN_URL>/suite/rest/a/content/latest/", concat( local!urlPrefix, local!documentDownloadLink.@attributes.@anyAttribute._documentDownloadLink, "/o" ) )