CSV import & export
Last updated
Was this helpful?
Was this helpful?
// Result of the previous step is available as data
const blob = new Blob([{{data}}], { type: 'plain/text' });
const url = URL.createObjectURL(blob);
// Create a temporary link element and trigger the download
const downloadLink = document.createElement('a');
downloadLink.href = url;
downloadLink.download = 'data.txt'; // Name your file here
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);
return blob;// Result of the previous step is available as data
const jsonData = JSON.stringify({{data}});
const blob = new Blob([jsonData], { type: 'application/json' });
const url = URL.createObjectURL(blob);
// Create a temporary link element and trigger the download
const downloadLink = document.createElement('a');
downloadLink.href = url;
downloadLink.download = 'data.json'; // Name your file here
document.body.appendChild(downloadLink);
downloadLink.click();
document.body.removeChild(downloadLink);const fileName = "your_file_name.extension"; // Replace with your desired file name and extension
const fileContent = {{data}}; // Assuming the file content is received in the 'data' variable
const blob = new Blob([fileContent], { type: "application/octet-stream" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
return { message: "File download triggered" };