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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Adfc_NZ
Contributor III
Contributor III

Identify which automation(s) are reloading which app(s)

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.

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
Daniele_Purrone
Support
Support

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"

Daniele - Principal Technical Support Engineer & SaaS Support Coordinator at Qlik
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

2 Replies
Daniele_Purrone
Support
Support

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"

Daniele - Principal Technical Support Engineer & SaaS Support Coordinator at Qlik
If a post helps to resolve your issue, please accept it as a Solution.
marksouzacosta

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