Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
OmarBenSalem

Reload Qlik Sense App via CMD command

Hi all,

Hope you're doing fine.

As clear in the title, I want to know if there is a way to reload a Qlik Sense App via command line? Maybe?

If there is, can you please share your knowledge with me?

I know that in qlikview, I can do as follow:

"C:\Program Files\QlikView\qv.exe" /R "C:\QlikviewApplications\app.qvw"


In Qlik Sense, I found this:

https://help.qlik.com/en-US/sense-developer/3.2/Subsystems/EngineAPI/Content/CreatingAppLoadingData/...

The handle of the app is 1. The DoReload method is used.

The client sends:

{ "jsonrpc": "2.0", "id": 2, "method": "DoReload", "handle": 1, "params": [] }

The engine returns:

{ "jsonrpc": "2.0", "id": 2, "result": { "qReturn": true }, "change": [ 2 ] }

The app is reloaded.

With that,I can reload an app with the Engine API explorer of the dev-hub:

Capture (1).PNG

Now, is there anyone who could /want to guide me on how to make this an automated task?

Imagine I have 5 applications I want to reload them each day like this but without having to do the work manually?

How to proceed?

I'm using Qlik Sense Desktop as you can see.

I found this:

https://help.qlik.com/en-US/sense-developer/3.2/Subsystems/EngineAPI/Content/GettingStarted/connecti...

Its says:

After you launch Qlik Sense Desktop and log in, you can connect to the Qlik Engine API using the following URI:

ws://localhost:4848/app/

For example, using JavaScript in a browser, make the following call:

var ws = new WebSocket("ws://localhost:4848/app");

I thus thought that to connect to the Engine API explorer; I had to copy this :

var ws = new WebSocket("ws://localhost:4848/app");


Then I used the 3 JSON scripts automatically generated and made sthing like this to execute with EasyPHP:

<?php

  var ws = new WebSocket("ws://localhost:4848/app");

$a={

  "handle": -1,

  "method": "GetDocList",

  "params": [],

  "outKey": -1,

  "id": 3

}

var_dump(json_decode($a));

$b={

  "method": "OpenDoc",

  "handle": -1,

  "params": [

  "C:\\Users\\BMC\\Documents\\Qlik\\Sense\\Apps\\reloadTest.qvf"

  ],

  "outKey": -1,

  "id": 2

}

var_dump(json_decode($b));

$c={

  "jsonrpc": "2.0",

  "id": 3,

  "method": "DoReload",

  "handle": 1,

  "params": [],

  "outKey": -1

}

var_dump(json_decode($c));

?>


But, obviously, I got an error :

Capture (2).PNG

What am I do wrong? what should I change or redo?

Is there a solution to reload many applications dynamically ?


It's a really urgent need, hope you'll help !

Thanks,

4 Replies
percy_musaka
Partner - Contributor II
Partner - Contributor II

In the tagged code you are treating JavaScript Code as PHP which will not work however using the following alongside your browser's developer tools to see the response will work.

```

<script>


  var ws = new WebSocket("ws://localhost:4848/app");
 
  var a={

  "handle": -1,
  "method": "GetDocList",
  "params": [],
  "outKey": -1,
  "id": 3

  }

  console.log(a);
 
  var b={

  "method": "OpenDoc",
  "handle": -1,
  "params": [

  "C:\\Users\\BMC\\Documents\\Qlik\\Sense\\Apps\\reloadTest.qvf"

  ],

  "outKey": -1,
  "id": 2

  }

  console.log(b);


  var c={

  "jsonrpc": "2.0",
  "id": 3,
  "method": "DoReload",
  "handle": 1,
  "params": [],
  "outKey": -1
  }

  console.log(c);

</script>

```

You can then use JS Websocket functions to reload and perform all the other functions you want.

Read More https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_application...

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

I've got to the point where I can see the three objects created in the console in Chrome.

What is the next step required to actually call these objects?

Being a Qlik developer rather than a web developer it's not at all obvious.


Thanks in advance,

Steve

arturomiquelveyrat
Partner - Contributor III
Partner - Contributor III

You can use QlikSenseReloader. Works both for Desktop and Enterprise versions.

steeramp
Partner - Creator II
Partner - Creator II

Hi Arturo ,

 

How can set my address ip and Application name for to reload in Enterprise Versions ?  Example

my hub : http://185.xx.xx.xx/sense/app/

appl name : 60d83ebf-3aab-4cea-a76d-e6a3c2fcc228