Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In our Qlik Cloud tenancy we have dozens of automations reloading apps in multiple spaces (Shared & Managed).
One thing we don't have visibility over, is which automation(s) are triggering the reload of which app(s) or the other way, looking at an app and identifying which Automation is triggering its reload (assuming the app is not being reloaded by a "schedule").
Has anyone encountered this hurdle and if and how did you overcome it?
Thank you.
Hi @Adfc_NZ ,
this is a great idea for ideation.
In the meantime, I have tried this powershell script that uses the Qlik-cli.
param (
[Parameter(Mandatory=$true)]
[string]$TargetAppId
)
# Check if qlik-cli is installed
if (-not (Get-Command qlik -ErrorAction SilentlyContinue)) {
Write-Error "qlik-cli is not installed or not in the PATH."
exit
}
Write-Host "--- Searching for Automations reloading App: $TargetAppId ---" -ForegroundColor Cyan
Write-Host "Fetching list of automations..." -ForegroundColor Gray
# 1. Get the list of all automations
# We use --json to ensure we get a machine-readable format
try {
$automationsList = qlik automation ls --json | ConvertFrom-Json
}
catch {
Write-Error "Failed to list automations. Please check your login (qlik context init)."
exit
}
$foundCount = 0
# 2. Loop through each automation found
foreach ($item in $automationsList) {
$autoId = $item.id
$autoName = $item.name
Write-Progress -Activity "Scanning Automations" -Status "Checking: $autoName"
# 3. Get the full definition (workspace) for this automation
try {
$def = qlik automation get $autoId --json | ConvertFrom-Json
}
catch {
Write-Warning "Skipping $autoName (Could not fetch definition)"
continue
}
# 4. Check the blocks inside the workspace
$blocks = $def.workspace.blocks
if ($null -ne $blocks) {
# Iterate through the blocks (blocks are properties of the 'blocks' object)
foreach ($block in $blocks.PSObject.Properties.Value) {
# CHECK 1: Is this a "DoReload" block?
if ($block.name -eq "DoReload") {
# CHECK 2: Look through the inputs for the App ID value
if ($null -ne $block.inputs) {
foreach ($inputItem in $block.inputs) {
# We specifically look for the "value" key matching your App ID
if ($inputItem.value -eq $TargetAppId) {
Write-Host "MATCH FOUND!" -ForegroundColor Green
Write-Host "Automation : $autoName"
Write-Host "Auto ID : $autoId"
Write-Host "Block Name : $($block.name)"
Write-Host "Matched ID : $($inputItem.value)"
Write-Host "------------------------------------------------"
$foundCount++
}
}
}
}
}
}
}
Write-Host "Done. Found $foundCount automation(s)." -ForegroundColor Cyan
You can try saving it as Find-ReloadAutomations.ps1
and then run it as:
.\Find-ReloadAutomations.ps1 -TargetAppId appId
It scans through the automations, and searches for those that have a DoReload block which includes the appId
It worked for me, but please consider that it is provided "as it is"
Hi @Adfc_NZ ,
this is a great idea for ideation.
In the meantime, I have tried this powershell script that uses the Qlik-cli.
param (
[Parameter(Mandatory=$true)]
[string]$TargetAppId
)
# Check if qlik-cli is installed
if (-not (Get-Command qlik -ErrorAction SilentlyContinue)) {
Write-Error "qlik-cli is not installed or not in the PATH."
exit
}
Write-Host "--- Searching for Automations reloading App: $TargetAppId ---" -ForegroundColor Cyan
Write-Host "Fetching list of automations..." -ForegroundColor Gray
# 1. Get the list of all automations
# We use --json to ensure we get a machine-readable format
try {
$automationsList = qlik automation ls --json | ConvertFrom-Json
}
catch {
Write-Error "Failed to list automations. Please check your login (qlik context init)."
exit
}
$foundCount = 0
# 2. Loop through each automation found
foreach ($item in $automationsList) {
$autoId = $item.id
$autoName = $item.name
Write-Progress -Activity "Scanning Automations" -Status "Checking: $autoName"
# 3. Get the full definition (workspace) for this automation
try {
$def = qlik automation get $autoId --json | ConvertFrom-Json
}
catch {
Write-Warning "Skipping $autoName (Could not fetch definition)"
continue
}
# 4. Check the blocks inside the workspace
$blocks = $def.workspace.blocks
if ($null -ne $blocks) {
# Iterate through the blocks (blocks are properties of the 'blocks' object)
foreach ($block in $blocks.PSObject.Properties.Value) {
# CHECK 1: Is this a "DoReload" block?
if ($block.name -eq "DoReload") {
# CHECK 2: Look through the inputs for the App ID value
if ($null -ne $block.inputs) {
foreach ($inputItem in $block.inputs) {
# We specifically look for the "value" key matching your App ID
if ($inputItem.value -eq $TargetAppId) {
Write-Host "MATCH FOUND!" -ForegroundColor Green
Write-Host "Automation : $autoName"
Write-Host "Auto ID : $autoId"
Write-Host "Block Name : $($block.name)"
Write-Host "Matched ID : $($inputItem.value)"
Write-Host "------------------------------------------------"
$foundCount++
}
}
}
}
}
}
}
Write-Host "Done. Found $foundCount automation(s)." -ForegroundColor Cyan
You can try saving it as Find-ReloadAutomations.ps1
and then run it as:
.\Find-ReloadAutomations.ps1 -TargetAppId appId
It scans through the automations, and searches for those that have a DoReload block which includes the appId
It worked for me, but please consider that it is provided "as it is"
Hi @Adfc_NZ ,
This is a tough one. I don't think Qlik Cloud tracks that. I have checked at all logs that I'm aware and I can't find anything that helps.
So, a workaround that I can think about is to log that in a database from the Automation (record the Automation Id and Reload Id would be the minimum information needed) or injecting the Automation Id and tracing that on the Reload Logs - or using Load Script to store this into a file, etc.
Regards,
Mark Costa
Read more at Data Voyagers - datavoyagers.net
Follow me on my LinkedIn | Know IPC Global at ipc-global.com