I have seen others post this issue with no response so here is hoping that this will increase the noise on this issue. It is extremely critical and urgent for us. We have been using the visual.ex...
JPW
4 years agoNew Member
As mentioned by stevenamani , calling exportData multiple times does seem to work. Here's a quick-and-dirty function you can call in your code that will do the retries (4 retries). Just pass the visual you're wanting to export data from as parameter.
async function exportData(visual: VisualDescriptor): Promise<models.IExportDataResult> {
// starting on 12/16/2021, exportData throws error.
// If call exportData repeatedly a few times then it starts to work.
// Implement pattern to try 4 times before throwing an error
let tries = 0;
let result: models.IExportDataResult;
while (tries < 4) {
try {
result = await visual.exportData(models.ExportDataType.Summarized);
break;
} catch (err) {
tries++;
if (tries === 4) {
throw err;
}
}
}
console.log(`exportData [tries]: ${tries}`);
return result;
}
And in your code where calling exportData currently throws an exception, replace
const result: models.IExportDataResult = await visual.exportData(models.ExportDataType.Summarized);
with
const result: models.IExportDataResult = await exportData(visual);