I am trying to create a writable stream to stream data fetch from tableau API call. The issue i am facing is that as soon as i tried to save to a particular location, it will refresh the page making it not able to fetch the data from the api call.
i believe await window.showSaveFilePicker() will refresh the page but i may be wrong on this. How can i not make page refresh as soon as i select a location.
below are the reference script that was used to
const getUnderlyingData = async() => {
const newHandle = await window.showSaveFilePicker();
const writableStream = await newHandle.createWritable();
sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get("TP MF Tickets");
options = {
maxRows: 0, // Max rows to return. Use 0 to return all rows
ignoreAliases: false,
ignoreSelection: false,
includeAllColumns: false
};
sheet.getSummaryDataAsync().then(async function (t) {
table = t;
for (let a = 0; a < table.getColumns().length; a++) {
await writableStream.write(table.getColumns()[a].getFieldName())
console.log(table.getColumns()[a].getFieldName())
}
});
}