Hi All,
I have a requirement to download the data into excel using web api in Appian. Data is coming from external API.
Using web api, I am able to dowload .csv and.xls file. But To download the .xlsx file. Is there any way.
Currently I am writing the sample code like below.
a!localVariables( local!data:{ {name:"A",age:10}, {name:"A",age:10}
}, a!httpResponse( headers: { a!httpHeader( name: "Content-Type", value: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ), a!httpHeader( name: "Content-Disposition", value: "attachment; filename= test.xlsx" ) }, body:local!data )
)
whenever i tried to open the file. Below is the error. Can you please tell how can we resolve this issue?
.
Thanks in Advance!!
Discussion posts and replies are publicly visible
Your code isn't turning the data into an Excel file ...
Trying to download data from an API, just to forward it to the user as an Excel file is not exactly a great use case for Appian.
I think you will have to write the data to a database table, and then use one of the plugins to export it into an XLSX file. Then you can make the user download it.