Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Dipti123
Contributor III
Contributor III

single control model containing buttons to reload other models

They expected that reloading the main model would automatically include the filters, without needing two separate uploads.
Their idea was to have a single control model containing buttons to reload other models (e.g., ReportBuilder, Ordinato, Fatturato), so that a user in Krino can reload any model manually when needed — without using triggers or automation.

Now, I’m trying to understand the best and most practical way to implement this in Qlik Sense —
➡️ Is it possible to trigger the reload of other apps using buttons inside a Qlik Sense app (via REST API or another method)?
➡️ Or is there a simpler alternative that fits this requirement better?

Any suggestions or best practices would be really helpful.

Thanks in advance!

5 Replies
HirisH_V7
Master
Master

Qlik Cloud:
Use Qlik Application Automation — create an automation that reloads the target app and trigger it via a webhook URL linked to a button inside your Qlik app.

Qlik Sense Enterprise (on-prem / SaaS):
Use the QRS REST API — call the "/ qrs / app / {appId} /reload" endpoint from a REST connection or custom extension to trigger another app’s reload.

HirisH
Dipti123
Contributor III
Contributor III
Author

I'm Using Qlik Sense Enterprise (on-prem / SaaS) 
so for this I need to add REST Connection  "/ qrs / app / {appId} /reload" with this API then what action i need toa dd on button 

Please guide 

Thank You

Dipti123
Contributor III
Contributor III
Author

hello 
Please guide  @HirisH_V7 

 

HirisH_V7
Master
Master

add a button and use an "Open URL" action that points to this webhook.

Example:

"https://<region>.qlikcloud.com/api/v1/automations/<automation-id>/run"


This way, pressing the button in App A calls the webhook → triggers reload of App B.

HirisH
Dipti123
Contributor III
Contributor III
Author

Im working with Qlik sense enterprise on button qlik i can reload the app with custom extenin but it wokrs fro Admin only not for anlayzer user or user other than ADMin 
How to proceed with this

define(['jquery'], function ($) {
'use strict';

// 🔹 Qlik Sense server URL (replace with your own)
const serverUrl = "https://your-qlik-server";

// 🔹 App names and IDs (replace * with actual IDs)
const apps = {
"Reload ReportBuilder": "********-****-****-****-************",
"Reload Ordinato": "********-****-****-****-************",
"Reload Fatturato": "********-****-****-****-************",
"Reload Acquisti": "********-****-****-****-************"
};

// 🔸 Generate random XRF key
function genXrfKey() {
const chars = '';
let k = '';
for (let i = 0; i < 16; i++) {
k += chars[Math.floor(Math.random() * chars.length)];
}
return k;
}

// 🔹 Trigger a reload task
function triggerReload(appLabel, $btn) {
const appId = apps[appLabel];
const xrfkey = genXrfKey();
const url = `${serverUrl}/qrs/app/${appId}/reload?xrfkey=${xrfkey}`;

const originalText = $btn.text();
$btn.prop('disabled', true).text('Ricarico in corso...');

$.ajax({
url: url,
type: 'POST',
headers: {
'X-Qlik-Xrfkey': xrfkey,
'Content-Type': 'application/json',
'Accept': 'application/json'
},
xhrFields: { withCredentials: true },
success: function () {
alert(`⚙️ ${appLabel} — il ricarico è stato avviato correttamente.`);
checkReloadStatus(appId, xrfkey, appLabel);
},
error: function (xhr) {
alert(` Impossibile avviare il ricarico: ${xhr.status} ${xhr.statusText}`);
console.error(xhr.responseText);
},
complete: function () {
$btn.prop('disabled', false).text(originalText);
}
});
}

// 🔹 Check reload status every 5 seconds
function checkReloadStatus(appId, xrfkey, appLabel) {
const taskUrl = `${serverUrl}/qrs/reloadtask?filter=app.id eq ${appId}&xrfkey=${xrfkey}`;

const interval = setInterval(() => {
$.ajax({
url: taskUrl,
type: 'GET',
headers: {
'X-Qlik-Xrfkey': xrfkey,
'Accept': 'application/json'
},
xhrFields: { withCredentials: true },
success: function (tasks) {
if (tasks && tasks.length > 0) {
const task = tasks[0];
const result = task.operational.lastExecutionResult;

if (result && result.status === 7) { // Success
clearInterval(interval);
alert(` ${appLabel} — Ricarico terminato con successo.`);
} else if (result && result.status === 😎 { // Failed
clearInterval(interval);
alert(` ${appLabel} — Il ricarico non è riuscito. Controllare i log nel QMC.`);
}
}
},
error: function (err) {
console.error('Errore nel controllo dello stato del ricarico:', err);
clearInterval(interval);
}
});
}, 5000);
}

// 🔹 Paint buttons
return {
paint: function ($element) {
$element.empty();
const $container = $('<div class="reload-grid"></div>');

Object.keys(apps).forEach(function (label) {
const $b = $('<button class="reload-btn"></button>')
.text(label)
.css({
margin: '30px',
padding: '6px 12px',
border: '1px solid rgb(204, 204, 204)',
'border-radius': '4px',
cursor: 'pointer',
'background-color': 'rgb(31, 133, 179)',
color: 'white',
'font-weight': '500'
})
.on('mouseenter', function () {
$(this).css('background-color', 'rgb(23, 110, 150)');
})
.on('mouseleave', function () {
$(this).css('background-color', 'rgb(31, 133, 179)');
})
.on('click', function () {
triggerReload(label, $b);
});

$container.append($b);
});

$element.append($container);
}
};
});

can you please hlep me how QRS APi or Reload APp works for other users than admin ?