Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION

Who Me Too'd this solution

alex_colombo
Employee
Employee

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)

 

View solution in original post

Who Me Too'd this solution