Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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.

4 Replies
Anonymous
Not applicable
Author

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_Naik
Partner - Creator II
Partner - Creator II

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

Anonymous
Not applicable
Author

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

tejes
Contributor III
Contributor III

Hi Josh, 

Could you please explain the process of exporting dimensions/measures. 

 

Regards,

Tej.