How to get the document ID from Appian documents.
Discussion posts and replies are publicly visible
Appian references documents by their ID already. So you can pass a valid integer to functions that expect a document, and vice versa.
And you can use tointeger() or the document() function to turn a document into a number, or get the ID from a document.
docs.appian.com/.../fnc_scripting_document.html
Thank you, your suggestion helped me achieve the user requirement of export to Excel and downloading from an interface on a Site. i used a!startProcess to trigger the process model asynchronously and it passes back the document ID where I got it by doing toInteger(pv!documentName) in the process model. Then in the interface, I did todocument(local!documentId)
Great to hear that. BTW, you do not need to cast to an integer and back to a document. Appian is extremely good in automatically converting values into the required type.
Thanks for the tip! I was unsure if the interface fv!process.info.pv... can pass back a process variable of type document. Just updated my interface and process model now
Triggering the process model -> fetching document id -> passing to Download document link. All these happened on one click?
yes. the interface's button widget can trigger a!startProcess and you can a!save the exported Excel document by using fv!processInfo.pv.excelDoc
On button widget -> in saveinto we can have startProcess and save result doc to local variable. So on same button widget can we configure document download link ? Can you provide screenshot if you have any? Thanks
muddasaniupenderreddyb0001 said:So on same button widget can we configure document download link ?
No. It would still need to be displayed separately (and then clicked on by the user) in order to actually download the document. Buttons can not trigger the actual document download in any sense, it has to be a link.