Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

jtzadoyko
New Contributor

Exporting Master Items using API

Hi everyone,

I am new to using the API and was wondering if it is possible to export a master items list created in any given application to an excel document (or any document for that matter). I have an app that has a number of master items (both measures and dimensions) and I need to document all its information and I thought there must be an easier way then to copy and paste everything. If someone could point me in the right direction or supply me with the code that would be awesome.

Thanks again everyone.

3 Replies
jtzadoyko
New Contributor

Re: Exporting Master Items using API

also I forgot to mention that if anyone knows a different way to export a list of the master items and all the information pertaining to each item that doesn't involve the API that works too!

prashant_n
New Contributor

Re: Exporting Master Items using API

Hi Joshua,

you can loop with the master item data and store it and write that data in excel

please follow below link to store the data in xls format

javascript - How to write data into an xls sheet in js - Stack Overflow

Or you can store the data in json format also for this here is the code.

var items=[];    //define an empty array

this.app.getAllInfos().then(res=>{    //get all the info of app

//here you can loop and check which masteritem (dimension/measure) is and store it in json format

items.push(res);

jsonfile.writeFile(Objlist, Items, function (err) {

  console.error(err)

})

})

Regards,

Prashant

joshua_zadoyko
New Contributor

Re: Exporting Master Items using API

Thank you Prashant.

After some further exploration the first technique you mentioned I had considered doing. One of my colleagues ended up figuring out a similar technique to your second suggestion and it worked out rather well! Thanks again for your input, much appreciated.

Regards,

Josh

Community Browser