Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Balamurugan
Contributor
Contributor

How to delete qlik variables using API from web application

Hi,

I have a web application with AngularJS MVC framework connected to Qlik Sense Apps. Now i want to create a page with all the user defined variable list for the selected qlik app and it is done. Now based on the variable selection from the list i want to delete it after click a button.

I came to know that there are some API calls available(destroyvariablebyid and destroyvariablebyname method). I dont know how to use it from the web application. It would be helpful if anyone provide a suggestion to delete variable from qlik thru API.

Thanks,

2 Replies
ajaykakkar93
Specialist III
Specialist III

Hi @Balamurugan ,

Can use engine to remove the variable

{
"handle": 1,
"method": "RemoveVariable",
"params": {
"qName": "Name of Variable"
}
}

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Balamurugan
Contributor
Contributor
Author

Hi,

i am able to delete the variable now destroyVariableByName

it is not showing in the console when its reply. But when i reload the webpage it is again appearing on my variable list. it is not getting deleted permanently. Am i missing something? i have full permission of the Qlik app ( i am the app owner/ also part of Developer role) 

qName ='xxxx';
var deferred = $q.defer();
qlikApp.model.engineApp.destroyVariableByName(qName)
 
.then(function() {
      console.log('Variable Removed');
      deferred.resolve();

       qlikApp.getList("VariableList", function(reply){console.log("reply = ",reply);
       })
}).catch(function(err) {
     deferred.reject(err);
     console.log(err);
});
return deferred.promise;