Hi,
I want to implement a functionality, wherein I am displaying a button, and on click of that buttton, I am letting user to download a file containing data from the database.
I am using exportDataStoreEntityToCsv() smart service to achieve this. But it is a 2 step process, and I am not quite sure how to integrate the download functionality in the button.
Can anyone help me in this ?
Discussion posts and replies are publicly visible
It will remain a two-step process as the first step is to run the smart service so it can generate the CSV file and another step to download the file. If somehow, you are able to generate this file without user needing to click on a button (like as soon as the user lands on a screen) or by combining it with any other action, then you will be able to use that single click for downloading.
Also, to download the file, you will need a link and not a button. Links cannot be applied to a button. You will have to use a component that supports adding like (eg. richTextDisplayField() or cardLayout())
My requirement is to use a button. If it were a link then there is a recipe available in the documentation.
And I told you. You CANNOT use a button to download the file.
Ok
like harshit said, you can use a cardlayout.You can try to use it like a button. https://docs.appian.com/suite/help/22.4/cards-as-buttons-pattern.htmlbut instead of a dynamic link you can use a documentdownload linkhttps://docs.appian.com/suite/help/22.4/Document_Link_Component.html