Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.
Hi @Qlik1_User1 , after you get the container object, you have to read which objects is containing. Then you have to perform a new getObject call pointing to the table you want to export. I usually use Engine APIs from Capability APis for doing this. Below an example:
//Wait Engine API promise
const promise = await app.model.waitForOpen.promise
//Get container object
const container = await app.model.enigmaModel.getObject('_yourContainerObjectId_');
//Get container layout for reading container children
const containerLayout = await container.getLayout();
//Get as an example the first children and then export its data (you should loop over children and do your stuff)
const chartOne = await app.model.enigmaModel.getObject(containerLayout.children[0].refId);
//Define export type as CSV
const exportDef = {
"qFileType": "CSV_C",
"qPath": "/qHyperCubeDef",
"qExportState": 0,
"qServeOnce": false
};
const exportData = await chartOne.exportData(exportDef);
//Print export url
console.log(exportData.qUrl)