Hi
My use case is as follows.
I have a button that initiates a process that creates an excel follow.
After pressing the button, and upon successful creation of the excel file, I want to display to the user a document download link.
As for the label of this link, I want it to say "Download + FileName", where the file name is a Local Variable
for example, I want the label of the link to say "Download Excel File Number 5" for example
Is there a way to make the label field dynamically displayed based on the value of a local variable.
Discussion posts and replies are publicly visible
Yes, in the 'label' field of the documentDownloadLink() you can do `"Download "&document(local!myDoc,"name")`
Thank you for the reply Danny, I receive this error when I use the proposed solution [label: `"Download "& local!documentName`]
"Expression evaluation error: Syntax error. Details: Expression evaluation error : Invalid character found in expression: ` (96)"
The ticks I used were just for this chat, you should remove them
Thank you Danny, much appreciated, it worked!
As a tangent, I recommend using only the Rich Text Display Field to show document download links (there's no reason to use a!linkField() anymore, for any reason IMHO). The primary reasoning here is that in the RTDF, the link can be enabled/disabled dynamically, and at the same time, you can easily add extra elements like icons if/when you choose.
Example:
a!richTextDisplayField( value: a!richTextItem( text: { local!documentName }, link: a!documentDownloadLink( document: local!generatedDoc, showWhen: not(isnull(local!generatedDoc)) ) ) )