how to save the file AS CSV !??
Hi,
You can refer below post ,
https://www.outsystems.com/forums/discussion/46173/converting-xls-to-csv/#:~:text=Import%20the%20Excel%20sheet%20with,result%20of%20the%20CSV%20component.
Thanks.
Hi Omar,
To save a file as CSV in OutSystems, you can follow these steps:
Create a new action that returns the data you want to include in the CSV file as a list.
Use the "Text_Join" function to join the list of data into a single string, separated by commas.
Use the "Text_ToBinary" function to convert the string into a binary file.
Return the binary file as a response to the user, with the content type set to "text/csv" and the
content-disposition set to "attachment" with a ".csv" extension.
Here's an example of what the code for this action might look like :
// Action to generate a CSV file
export function GenerateCSV(data: List of String): Binary
{
// Join the list of data into a single string
var csvString = Text_Join(data, ",");
// Convert the string into a binary file
var csvFile = Text_ToBinary(csvString);
// Return the binary file as a response
Response.ContentType = "text/csv";
Response.AddHeader("Content-Disposition", "attachment; filename=data.csv");
return csvFile;
}
you can modify this code according to your application or logic.