qlik_generate_app
Create or update Qlik Sense applications with load scripts and data connections for analytics workflows.
Instructions
Create or update a Qlik Sense app with load script and data connections.
Cloud workflow:
qlik_get_dataset_details → get connection info
qlik_generate_app with script
On-Premise workflow (Engine API):
Create app via Global.CreateApp
Optionally create data connection via Doc.CreateConnection
Set script via Doc.SetScript
Reload via Doc.DoReload
Save via Doc.DoSave
On-Premise Data Connections:
Folder: { "connectionName": "MyData", "connectionType": "folder", "connectionString": "C:\Data\" }
ODBC: { "connectionName": "SQLServer", "connectionType": "ODBC", "connectionString": "DSN=MyDSN" }
On-Premise Discovery (no appName/appId needed):
listOdbcDsns: true → List available ODBC data sources on server
listConnections: true + appId → List connections in existing app
Cloud Load Script - File from Space: IMPORTANT: Use format [lib://:DataFiles/]
Example: FROM [lib://BI TEAM WORKSPACE:DataFiles/sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
Example: FROM [lib://Finance Team:DataFiles/report.qvd] (qvd);
WRONG format: FROM [lib://DataFiles (spaceId)/file.csv] ← Do NOT use this!
On-Premise Load Script Examples:
Folder: LOAD * FROM [lib://MyData/sales.csv] (txt, codepage is 1252, embedded labels, delimiter is ',', msq);
ODBC: LIB CONNECT TO 'MyODBC'; SQL SELECT * FROM Sales;
Returns: appId, appName, appLink, reloadStatus, connections, odbcDsns
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appName | No | Name for new app (creates in personal space) | |
| appId | No | Existing app ID (updates the app) | |
| loadScript | No | Qlik load script | |
| dataConnection | No | On-Premise only: Create a data connection before loading | |
| listConnections | No | On-Premise only: List existing connections in the app (requires appId) | |
| listOdbcDsns | No | On-Premise only: List available ODBC data sources on the server |