The lazy Qlik developer #3: Bulk export/import of both apps and reload tasks

Ctrl-Q now supports bulk export of both Qlik Sense apps and reload tasks, as well as storing associated metadata in a file on disk. Then import those apps/tasks into Sense again. Reload-tasks-as-code is now possible!

The lazy Qlik developer #3: Bulk export/import of both apps and reload tasks
Photo by Pablo Añón / Unsplash

The concepts in this post have the potential to save you hours of repetitive, error prone work when copying Qlik Sense apps from one system to another.

Follow along and adapt the various "actions" to your local Sense environment, there really isn't much work needed to get bulk export/import of both apps and tasks working.

💤
tl;drUsing just three commands you can export any number of apps and tasks from Sense, then import them into the same or some other Sense environment.Great for DEV-TEST-PROD app/task promotion, as a solid backup solution or for setting up reload-tasks-as-code based workflows.The concept described here has been tested on 100+ apps with hundreds of associated reload tasks.

This text is really a summary of several recent posts (link, link) on this site, but as the most recent version of Ctrl-Q (3.8.3 at the time of this writing) has added features for bulk exporting of apps, the pieces have come together and we now have a pretty good setup for bulk handling of both apps and reload tasks.

There are really just 3 different commands needed to extract any set of apps and reload tasks from Sense and then import them back into the same - or another - Sense environment.
The concept below can thus be used to very effectively to migrate apps from one Sense system to another, for example from DEV to TEST to PROD, or when migrating to a new server.

It's also possible to use the task import feature as a way to enfore structure and consistency in the task chains. If all task relations are defined in a single file (which can be stored in Git!) that is then reviewed before it is imported into Sense, you get a very solid process that probably will result in fewer errors compared to everyone defining their own task chains in the QMC.

Some of you will probaly say that "there are already tools for this, for example Qlik CLI".

True, but writing a complete suite of PowerShell scripts for doing bulk export AND import of both apps AND tasks has proven to be quite challenging.
Ctrl-Q tries to simplify things by packaging high-value use cases into a single (or a small number of) command(s).

Ctrl-Q is simply a nice tool to have if you're somewhat lazy... 😎

TODO list

We're going to do the following:

  1. Download and get started using Ctrl-Q
  2. Export Sense apps to .qvf files
  3. Export Sense reload tasks to Excel file
  4. Review and modify task definitions
  5. Import apps and tasks into Sense

1. Download and get started using Ctrl-Q

Ctrl-Q is free to use, using the MIT open source license.

Download the tool from the releases page on GitHub. There are binaries available for Windows, macOS and Linux.

There is no need to install Ctrl-Q, just place it in a suitable directory on your computer, for example c:\tools\ctrl-q.

Now let's make sure Ctrl-Q can run on your computer. On Windows (using Microsoft's excellent Windows Terminal) you should see something like below.

Action: Run Ctrl-Q on your computer and make sure it runs without errors.
PS C:\tools\ctrl-q> .\ctrl-q.exe
Usage: index [options] [command]

Ctrl-Q is a command line utility for interacting with client-managed Qlik Sense Enterprise on Windows servers.
Among other things the tool does bulk import of apps and tasks, manipulates master items and scrambles in-app data.

Options:
  -V, --version                         output the version number
  -h, --help                            display help for command

Commands:
  master-item-import [options]          create master items based on definitions in a file on disk
  master-item-measure-get [options]     get info about one or more master measures
  master-item-measure-delete [options]  delete master measure(s)
  master-item-dim-get [options]         get info about one or more master dimensions
  master-item-dim-delete [options]      delete master dimension(s)
  field-scramble [options]              scramble one or more fields in an app. A new app with the scrambled data is created.
  script-get [options]                  get script from Qlik Sense app
  bookmark-get [options]                get info about one or more bookmarks
  task-get [options]                    get info about one or more tasks
  task-custom-property-set [options]    update a custom property of one or more tasks
  task-import [options]                 create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.
  app-import [options]                  import apps/upload QVF files on disk to Sense based on definitions in Excel file.
  app-export [options]                  export Qlik Sense apps to QVF files on disk.
  help [command]                        display help for command
PS C:\tools\ctrl-q>

Great, we now know that Ctrl-Q starts as it should.

2. Export Sense apps to .qvf files

Let's export some apps from Sense. These will be stored as .qvf files in the same way as when apps are exported using the QMC.

First take a look at what options the "app-export" offers.

Action: Run Ctrl-Q's "app-export" command with the "--help" parameter.
PS C:\tools\ctrl-q> .\ctrl-q.exe app-export --help
Usage: index app-export [options]

export Qlik Sense apps to QVF files on disk.

Options:
  --log-level <level>                log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                      Qlik Sense server IP/FQDN
  --port <port>                      Qlik Sense server engine port (default: "4242")
  --schema-version <string>          Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>           Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>              connection to Qlik Sense engine is via https (default: true)
  --auth-user-dir <directory>        user directory for user to connect with
  --auth-user-id <userid>            user ID for user to connect with
  -a, --auth-type <type>             authentication type (choices: "cert", default: "cert")
  --auth-cert-file <file>            Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>        Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>       Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --app-id <ids...>                  use app IDs to select which apps to export
  --app-tag <tags...>                use app tags to select which apps to export
  --output-dir <directory>           relative or absolut path in which QVF files should be stored. (default: "qvf-export")
  --qvf-name-format <format...>      structure of QVF file name format (choices: "app-id", "app-name", "export-date", "export-time", default: ["app-name"])
  --qvf-name-separator <separator>   character used to separate parts of the QVF file name (choices: "-", "--", "_", "__", default: "_")
  --qvf-overwrite                    overwrite existing QVF files without asking
  --exclude-app-data <true|false>    exclude or include app data in QVF file (default: true)
  --limit-export-count <number>      export at most x number of apps. Defaults to 0 = no limit (default: 0)
  --sleep-app-export <milliseconds>  Wait this long before continuing after each app has been exported. Defaults to 1000 = 1 second (default: 1000)
  --metadata-file-create             create a separate file with information about all exported apps
  --metadata-file-name <name>        file name to store app metadata in (default: "app_export.xlsx")
  --metadata-file-format <format>    file type/format (choices: "excel", default: "excel")
  --metadata-file-overwrite          overwrite app metadata file without asking
  --dry-run                          do a dry run, i.e. do not export any apps - just show what would be done
  -h, --help                         display help for command
PS C:\tools\ctrl-q>

Quite a few options there, offering a lot of flexibility when exporting apps.
In the command below some default values will be used, you get the default values for all parameters by running Ctrl-Q with the "--help" parameter.

Now let's export all apps having the tag "Ctrl-Q demo" set.

  • The created .qvf files should be stored in a folder called "qvf-export".
  • Export the apps withing any data in them.
  • The file name of the exported QVFs should be made up of <app name> and <export date>, with a "_" as the separator in between.
  • Create an Excel file with information about each exported app. The default file name "app_export.xlsx" will be used.
Action: Export apps from Sense to QVF files.Adapt the host name, user directory/id, certificate locations and app tags to match your local setup.
PS C:\tools\ctrl-q> ./ctrl-q app-export `
>> --auth-type cert `
>> --auth-cert-file ./cert/client.pem `
>> --auth-cert-key-file ./cert/client_key.pem `
>> --host 192.168.100.109 `
>> --auth-user-dir LAB `
>> --auth-user-id goran `
>> --output-dir qvf-export `
>> --app-tag "Ctrl-Q demo" `
>> --exclude-app-data true `
>> --qvf-name-format app-name export-date `
>> --qvf-name-separator _ `
>> --metadata-file-create
2023-03-31T14:26:39.812Z info: -----------------------------------------------------------
2023-03-31T14:26:39.812Z info: | Ctrl-Q
2023-03-31T14:26:39.812Z info: |
2023-03-31T14:26:39.812Z info: | Version      : 3.8.3
2023-03-31T14:26:39.828Z info: | Log level    : info
2023-03-31T14:26:39.828Z info: |
2023-03-31T14:26:39.828Z info: | Command      : app-export
2023-03-31T14:26:39.828Z info: |              : export Qlik Sense apps to QVF files on disk.
2023-03-31T14:26:39.828Z info: |
2023-03-31T14:26:39.828Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2023-03-31T14:26:39.828Z info: |
2023-03-31T14:26:39.828Z info: | https://github.com/ptarmiganlabs/ctrl-q
2023-03-31T14:26:39.828Z info: ----------------------------------------------------------
2023-03-31T14:26:39.828Z info:
2023-03-31T14:26:39.828Z info: Export apps to directory "C:/tools/ctrl-q/qvf-export"
2023-03-31T14:26:39.937Z info: Number of apps to export: 3
2023-03-31T14:26:40.437Z info: ------------------------------------
2023-03-31T14:26:40.437Z info: App [22d58242-902d-42e0-afb5-2dd00cb754ec] "App 2.qvf", download starting
2023-03-31T14:26:40.499Z info: ✅ App [22d58242-902d-42e0-afb5-2dd00cb754ec] "App 2.qvf", download complete. Size=180224 bytes
2023-03-31T14:26:42.046Z info: ------------------------------------
2023-03-31T14:26:42.046Z info: App [7e9f6408-e3d5-44c3-808a-632a71fe359f] "App 3.qvf", download starting
2023-03-31T14:26:42.124Z info: ✅ App [7e9f6408-e3d5-44c3-808a-632a71fe359f] "App 3.qvf", download complete. Size=180224 bytes
2023-03-31T14:26:43.625Z info: ------------------------------------
2023-03-31T14:26:43.625Z info: App [83116805-c1e4-4716-9453-71a297b17257] "App 1.qvf", download starting
2023-03-31T14:26:43.718Z info: ✅ App [83116805-c1e4-4716-9453-71a297b17257] "App 1.qvf", download complete. Size=180224 bytes
2023-03-31T14:26:44.734Z info: ------------------------------------
2023-03-31T14:26:44.750Z info: ✅ Done writing app metadata file "app_export.xlsx" to disk
PS C:\tools\ctrl-q>

In the example above 3 apps had the "Ctrl-Q demo" tag set and were thus exported.

The "qvf-export" folder contains 3 .qvf files and one Excel file (containg info about the various .qvf files):

PS C:\tools\ctrl-q> dir .\qvf-export\


    Directory: C:\tools\ctrl-q\qvf-export


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        31/03/2023     16:26         180224 App 1_2023-03-31.qvf
-a----        31/03/2023     16:26         180224 App 2_2023-03-31.qvf
-a----        31/03/2023     16:26         180224 App 3_2023-03-31.qvf
-a----        31/03/2023     16:26          16450 app_export.xlsx


PS C:\tools\ctrl-q>

3. Export Sense reload tasks to Excel file

Similar to previous step, but for reload tasks. The command "task-get" is used to get - and export to disk - info about reload tasks.

Action: Run Ctrl-Q's "task-get" command with the "--help" parameter to understand what parameters are available.
PS C:\tools\ctrl-q> .\ctrl-q.exe task-get --help
Usage: index task-get [options]

get info about one or more tasks

Options:
  --log-level <level>            log level (choices: "error", "warn", "info", "verbose", "debug", "silly", default: "info")
  --host <host>                  Qlik Sense server IP/FQDN
  --port <port>                  Qlik Sense repository service (QRS) port (default: "4242")
  --schema-version <string>      Qlik Sense engine schema version (default: "12.612.0")
  --virtual-proxy <prefix>       Qlik Sense virtual proxy prefix (default: "")
  --secure <true|false>          connection to Qlik Sense engine is via https (default: true)
  --auth-user-dir <directory>    user directory for user to connect with
  --auth-user-id <userid>        user ID for user to connect with
  -a, --auth-type <type>         authentication type (choices: "cert", default: "cert")
  --auth-cert-file <file>        Qlik Sense certificate file (exported from QMC) (default: "./cert/client.pem")
  --auth-cert-key-file <file>    Qlik Sense certificate key file (exported from QMC) (default: "./cert/client_key.pem")
  --auth-root-cert-file <file>   Qlik Sense root certificate file (exported from QMC) (default: "./cert/root.pem")
  --task-type <type>             type of tasks to list (choices: "reload", default: "reload")
  --task-id <ids...>             use task IDs to select which tasks to retrieve. Only allowed when --output-format=table
  --task-tag <tags...>           use tags to select which tasks to retrieve. Only allowed when --output-format=table
  --output-format <format>       output format (choices: "table", "tree", default: "tree")
  --output-dest <dest>           where to send task info (choices: "screen", "file", default: "screen")
  --output-file-name <name>      file name to store task info in (default: "")
  --output-file-format <format>  file type/format (choices: "excel", "csv", "json", default: "excel")
  --output-file-overwrite        overwrite output file without asking
  --text-color <show>            use colored text in task views (choices: "yes", "no", default: "yes")
  --tree-icons                   display task status icons in tree view
  --tree-details [detail...]     display details for each task in tree view (choices: "taskid", "laststart", "laststop", "nextstart", "appname", "appstream", default: "")
  --table-details [detail...]    which aspects of tasks should be included in table view (choices: "common", "lastexecution", "tag", "customproperty", "schematrigger", "compositetrigger", "comptimeconstraint",
                                 "comprule", default: "")
  -h, --help                     display help for command
PS C:\tools\ctrl-q>

Again, plenty of options that can be used to extract task-related information in various forms. In this case we want to save that info to an Excel file.

Action: Export reload task definitions from Sense to an Excel file.Adapt the host name, user directory/id, certificate locations and task tags to match your local setup.
PS C:\tools\ctrl-q> ./ctrl-q task-get `
>> --auth-type cert `
>> --auth-cert-file ./cert/client.pem `
>> --auth-cert-key-file ./cert/client_key.pem `
>> --host 192.168.100.109 `
>> --auth-user-dir LAB `
>> --auth-user-id goran `
>> --task-tag "Ctrl-Q demo" `
>> --output-format table `
>> --output-dest file `
>> --output-file-format excel `
>> --output-file-name reload-tasks.xlsx
2023-03-31T14:36:18.177Z info: -----------------------------------------------------------
2023-03-31T14:36:18.177Z info: | Ctrl-Q
2023-03-31T14:36:18.177Z info: |
2023-03-31T14:36:18.177Z info: | Version      : 3.8.3
2023-03-31T14:36:18.177Z info: | Log level    : info
2023-03-31T14:36:18.177Z info: |
2023-03-31T14:36:18.177Z info: | Command      : task-get
2023-03-31T14:36:18.177Z info: |              : get info about one or more tasks
2023-03-31T14:36:18.177Z info: |
2023-03-31T14:36:18.177Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2023-03-31T14:36:18.177Z info: |
2023-03-31T14:36:18.177Z info: | https://github.com/ptarmiganlabs/ctrl-q
2023-03-31T14:36:18.177Z info: ----------------------------------------------------------
2023-03-31T14:36:18.177Z info:
2023-03-31T14:36:18.239Z info: Successfully retrieved 20 tags from QSEoW
2023-03-31T14:36:19.021Z info: ✅ Writing task table to disk file "reload-tasks.xlsx".
PS C:\tools\ctrl-q>

Let's see what files we have in the folder where Ctrl-Q was started:

PS C:\tools\ctrl-q> dir


    Directory: C:\tools\ctrl-q


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----        01/11/2022     14:45                cert
d-----        31/03/2023     16:26                qvf-export
-a----        31/03/2023     15:27       36867232 ctrl-q.exe
-a----        31/03/2023     16:36          26543 reload-tasks.xlsx


PS C:\tools\ctrl-q>

What does the task chain look like?

We will look at the reload tasks in a bit and then see that the 3 exported apps are reloaded in sequence, starting with App 1, followed by App 2 and finally App 3.

We can view this in a task tree view too. Ctrl-Q gives you the whole task tree, below only a subset of tasks are shown:

PS C:\tools\ctrl-q> ./ctrl-q task-get `
>> --auth-type cert `
>> --auth-cert-file ./cert/client.pem `
>> --auth-cert-key-file ./cert/client_key.pem `
>> --host 192.168.100.109 `
>> --auth-user-dir LAB `
>> --auth-user-id goran `
>> --output-format tree `
>> --output-dest screen
2023-03-31T17:55:08.721Z info: -----------------------------------------------------------
2023-03-31T17:55:08.721Z info: | Ctrl-Q
2023-03-31T17:55:08.721Z info: |
2023-03-31T17:55:08.721Z info: | Version      : 3.8.3
2023-03-31T17:55:08.721Z info: | Log level    : info
2023-03-31T17:55:08.721Z info: |
2023-03-31T17:55:08.721Z info: | Command      : task-get
2023-03-31T17:55:08.721Z info: |              : get info about one or more tasks
2023-03-31T17:55:08.721Z info: |
2023-03-31T17:55:08.721Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2023-03-31T17:55:08.721Z info: |
2023-03-31T17:55:08.721Z info: | https://github.com/ptarmiganlabs/ctrl-q
2023-03-31T17:55:08.721Z info: ----------------------------------------------------------
2023-03-31T17:55:08.721Z info:
2023-03-31T17:55:08.815Z info: Successfully retrieved 20 tags from QSEoW
2023-03-31T17:55:10.018Z info: # rows in tree: 24
2023-03-31T17:55:10.018Z info:
├─ --==| Scheduled tasks |==--
│  ├─ Reload task of Meetup.com
│  ├─ Manually triggered reload of Always failing reload (no delay)
│  │  └─ Reload task of Lab 1_1
...
...
│  ├─ Manually triggered reload of Always failing reload (no delay)
│  │  └─ Reload task of Lab 1_1
reloading)
│  └─ Reload task of App 1
│     └─ Reload task of App 2
│        └─ Reload task of App 3
├─ Manually triggered reload of HR metrics 2015-2020
│  └─ Manually triggered reload of Performance review

Looks good, the task chain starts with a scheduled task for App 1, followed by tasks for App 2 and App 3.

4. Review and modify task definitions

Let's take a look at the two Excel files that Ctrl-Q has created for us.

If our goal is to import the apps into Sense and create new reload tasks for those imported apps, we need to make some changes to the Excel files.

App definitions file

App definitions file created by Ctrl-Q

Note the "App counter" and "App name" columns, we will need them in a bit.

This file also contains info on what stream the apps were published to, who the owner was and what tags/custom properties were set for each app.

Action: Review the contents of the app_export.xlsx file to understand what info it contains.

Reload task definitions file

Reload tasks can be rather complex and this file therefore has a lot more columns.

The good news is that any kind of reload task chain can be defined in this Excel file. This means that any chain of reload tasks that you have created in the QMC can be exported to this Excel file - and vice versa.

The content of the reload-tasks.xlsx file from our example looks like this:

First set of columns in the task definitions Excel file
Second set of columns in the task definitions Excel file

Note the "Task id" (column D), "App id" (column H) and "Rule task id" (column AM). We will need them in a bit.

The many columns in this file may seem overwhelming at first, but when looking closer at them we realise that everything related to reload tasks in the QMC is also found in this Excel file.

There are some additional columns though, mainly various counters (Task counter, Event counter and Rule counter) that uniquely identify tasks, events and trigger rules.

Action: Review the contents of the reload-tasks.xlsx file to understand what info it contains.

Copy app info to task definitions file

The last step (5. Import apps and tasks into Sense) requires both app and task definitions to be on separate sheets in a single Excel file.

The task definitions file "reload-tasks.xlsx" already has a sheet called "Ctrl-Q task export", let's now bring in the app definitions too.

Action: Create a new sheet in "reload-tasks.xlsx", call it "Ctrl-Q app export".Then copy everything from the app definitions file "app_export.xlsx" into that new sheet.

"reload-tasks.xlsx" now looks like this:

A combined app- and task-definitions Excel file

If we look at the task definitions exported from Sense it's clear that each task refers to an app that already exists in Sense. This is column H, "App id". Not that strange as the task export after all reflect what already exists in Sense.

We however want the tasks that we will import into Sense to refer to the apps that will be imported, i.e. apps that don't yet exist in Sense. We thus have modify the Excel file to reflect this.

A special syntax is used to tell Ctrl-Q that an app id on the task definitions sheet refers to a not-yet-imported app:
Setting the column H "App id" to "newapp-1" tells Ctrl-Q that this task is associated with the app-to-be-imported that has a value of 1 in column A "App counter".
In other words: Column H in the task definitions sheet is associated with column A in the app definitions sheet. More info in the docs.

Action: Modify column H in the task definitions sheet so it links to column A in the app definitions sheet, using the "newapp-x" syntax.
ℹ️
If column H in the task definitions sheet contains a valid GUID, Ctrl-Q will (when it imports the tasks) assume it refers to an app id that already exists in Sense.

Looks like this using the same task definitions as before:

Reload tasks modified to refer to apps not yet imported into Sense

Now lets' build a task chain using those tasks that will be imported into Sense.

Scroll to the rightmost column of the task definitions, column AM "Rule task id".
All the columns from AF to AM refer to "composite tasks", which is what's used to create task chains. Column AK "Rule state" for example tells whether the previous task should succeed of fail for the event to trigger. Just like in the QMC.

Back to column AM "Rule task id".

  • If this column contains a valid GUID, Ctrl-Q will assume it's a task id already existing in Sense.
  • If this column contains an integer it's assumed to be a "fake" task id found in column D "Task id" of the task definitions.
    The fake task id just a Ctrl-Q specific way of linking a task's event trigger to an upstream task that hasn't yet been imported into Sense.

In other words similar to how tasks refer to apps.

Action: Modify column AM "Rule task id" on the task definitions sheet to make "Reload task of App 2" trigger when "Reload task of App 1" has finished reloading."Reload task of App 3" should trigger when "Reload task of App 2" has finished reloading.

Looks like this (with some columns hidden to make things easier to understand):

Building a task chain in the task definitions Excel file

5. Import apps and tasks into Sense

Allright, we're close now.

Last step is to import apps and their associated tasks into Sense. The task chain we have created will be imported too, of course.

Action: Adapt the "task-import" command below to your local Sense environment, then import apps and tasks into Sense.
PS C:\tools\ctrl-q> ./ctrl-q task-import `
>> --auth-type cert `
>> --host 192.168.100.109 `
>> --auth-cert-file ./cert/client.pem `
>> --auth-cert-key-file ./cert/client_key.pem `
>> --auth-user-dir LAB `
>> --auth-user-id goran `
>> --file-type excel `
>> --file-name reload-tasks.xlsx `
>> --sheet-name "Ctrl-Q task export" `
>> --import-app `
>> --import-app-sheet-name "Ctrl-Q app export"
2023-03-31T18:37:47.854Z info: -----------------------------------------------------------
2023-03-31T18:37:47.869Z info: | Ctrl-Q
2023-03-31T18:37:47.869Z info: |
2023-03-31T18:37:47.869Z info: | Version      : 3.8.3
2023-03-31T18:37:47.869Z info: | Log level    : info
2023-03-31T18:37:47.869Z info: |
2023-03-31T18:37:47.869Z info: | Command      : task-import
2023-03-31T18:37:47.869Z info: |              : create tasks based on definitions in a file on disk, optionally also importing apps from QVF files.
2023-03-31T18:37:47.869Z info: |
2023-03-31T18:37:47.869Z info: | Run Ctrl-Q with the '--help' option to see a list of all available options for this command.
2023-03-31T18:37:47.869Z info: |
2023-03-31T18:37:47.869Z info: | https://github.com/ptarmiganlabs/ctrl-q
2023-03-31T18:37:47.869Z info: ----------------------------------------------------------
2023-03-31T18:37:47.869Z info:
2023-03-31T18:37:47.869Z info: Import tasks from definitions in file "reload-tasks.xlsx"
2023-03-31T18:37:47.932Z info: Successfully retrieved 20 tags from QSEoW
2023-03-31T18:37:47.963Z info: Successfully retrieved 29 custom properties from QSEoW
2023-03-31T18:37:47.979Z info: (1) Importing app "App 2" from file "C:/tools/ctrl-q/qvf-export/App 2_2023-03-31.qvf"
2023-03-31T18:37:49.948Z info: (2) Importing app "App 3" from file "C:/tools/ctrl-q/qvf-export/App 3_2023-03-31.qvf"
2023-03-31T18:37:52.073Z info: App "App 3" published to stream "Ctrl-Q demo apps".
2023-03-31T18:37:52.073Z info: (3) Importing app "App 1" from file "C:/tools/ctrl-q/qvf-export/App 1_2023-03-31.qvf"
2023-03-31T18:37:54.417Z info: App "App 1" published to stream "Ctrl-Q demo apps".
2023-03-31T18:37:54.463Z info: CREATE RELOAD TASK IN QSEOW: "Reload task of App 1", new task id: 23f2d532-69f6-428e-93aa-06522d3a72bd. Result: 201/Created.
2023-03-31T18:37:54.527Z info: CREATE RELOAD TASK IN QSEOW: "Reload task of App 2", new task id: 356d88f2-a400-4ac9-b645-d25a5b3003be. Result: 201/Created.
2023-03-31T18:37:54.573Z info: CREATE RELOAD TASK IN QSEOW: "Reload task of App 3", new task id: 65b5f780-9d00-48c9-8a02-ca3da0a32d15. Result: 201/Created.
2023-03-31T18:37:54.573Z info: -------------------------------------------------------------------
2023-03-31T18:37:54.573Z info: Creating composite events for the just created tasks...
2023-03-31T18:37:54.666Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When App 1 has finished reloading" for task ID 356d88f2-a400-4ac9-b645-d25a5b3003be. Result: 201/Created.
2023-03-31T18:37:54.761Z info: CREATE COMPOSITE EVENT IN QSEOW: Event name="When App 2 has finished reloading" for task ID 65b5f780-9d00-48c9-8a02-ca3da0a32d15. Result: 201/Created.

And that's it! 🎉

There are now three new apps in the QMC:

Apps imported using Ctrl-Q

A few things to note:

  • The app owner was set using information in the app definition sheet in the Excel file.
  • If a stream name is specified in the Excel file, the app will be published to that stream.
  • Tags and custom properties (the latter not shown above) defined in the Excel file are applied to the imported apps.

Let's look at the new reload tasks too:

Reload tasks imported using Ctrl-Q

Similar to apps, every configurable aspect of the new tasks is defined in the Excel file:

  • Task name and associated app.
  • How the task is triggered, i.e. by schedule, task event trigger or a combination of both.
  • ... and all other aspects of reload tasks.

Did we succeed in creating a reload chain?
Yes we did:

Are there not tools already doing this?

Yes and no.

It's certainly possible to create something similar using a combination of Qlik's official Qlik CLI tool and the older (but still awesome!) Qlik-Cli for Windows.

My personal experience is however that it can be difficult and complex to find an easy to use, yet maintanable solution using these tools. For example, it's not entirely easy to include fully configurable task definitions in files on disk. Possible, but difficult.

Ctrl-Q tries to encapsulate complex scenarios such as bulk export/import of apps and tasks into simple to use commands that really support effective ways of working.

But again - Ctrl-Q is an opinionated tool that may work really well for some people and less so for others. As with most things.

Future enhancements

While Ctrl-Q's current feature set is very useful indeed things can always be improved.

On the todo list there are things such as

  • Support for external tasks in addition to reload tasks
  • Other means of authentication with the Qlik Repository Service API. Specifically JWT authentication would be useful.

Feel free to add your ideas in the discussions section over at GitHub!