Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III

Qsock deleteConnection method : Not able to delete Qlik sense Desktop connection

Hi All,

I want delete data connection of app in Qlik sense Desktop. I am using qsock object for that. I have written following code to delete Data connection but no luck. Not getting any error but Data connection is also not deleted. i am missing something in passing parameters in deleteConnection method.

Code :

const qsocks = require('qsocks');

const connectionName = 'Test';

qsocks.Connect( {appname: connectionName } )

.then( global => {

    // Access to the global class

    // http://help.qlik.com/en-US/sense-developer/2.2/Subsystems/EngineAPI/Content/Classes/GlobalClass/Glob...

    return global.openDoc( connectionName )

          .then( app => {

               console.log('Deleting')

               return app.deleteConnection('1e9290c4-eb65-4b05-bce9-e21bdbb88dc1').then(function(reply) {

               console.log('Deleted: ' +reply)

          })

     })

     .then(() => {

             // Close our connection.

             return global.connection.close();

         })

         .catch( err => {

             console.log( err )

         })

})

.then(() => {

    console.log('Done!')

})

Please Help.

Thanks & Regards,

Swapnil

1 Solution
6 Replies
ErikWetterberg

Have you verified the connection ID? It looks too short in your example.

Hope this helps

Erik Wetterberg

swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III
Author

Hi Erik,

Yes i have verified Connection ID from Qlik sense Dev Hub. It is correct.

Thanks & Regards,

Swapnil

swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III
Author

Hi Erik,

Thanks a Lot. its working fine now.

Thanks & Regards,

Swapnil

ErikWetterberg

Glad it helped. It's easy to forget about saving the appin desktop.

Erik Wetterberg

swapnil_kumbhar
Partner - Contributor III
Partner - Contributor III
Author

yes small things create big troubles.