Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
jornk
Contributor II
Contributor II

Edit app data load script using API

Hi,

I'm struggling to find an API that offers functionality for editing the data load script of a Qlik app.

I have a scenario where I have a stream of template apps that are going to be copied over to multiple customer streams. In that regard I'd like to edit the datasource, through API functionality, of each app copy, so that I can load data from the corresponding customer database.

Thanks in advance! 🙂

Regards
Jørn

1 Solution
10 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You can get and set the script using Doc.GetScript/SetScript 

https://help.qlik.com/en-US/sense-developer/November2021/Subsystems/EngineJSONAPI/Content/service-do...

There are also command line utilities that can set script. 

What language are you using?

-Rob

jornk
Contributor II
Contributor II
Author

Great, thanks! I will look into this 🙂 I'm using .NET Core when communicating with the APIs.

Steve_Rosebrook
Contributor II
Contributor II

Hi Rob.  I was curious about your statement that "There are also command line utilities that can set script".  I'm working on some automation using Powershell and Qlik CLI, and am able to duplicate apps and download them as QVF files (for copying/importing into upper environments).  But first I need to make changes to the load script of those duplicate apps to update the binary load statements in them, and I simply cannot figure out how to get Powershell/CLI to accomplish that.  I wasn't sure if it was possible or not with those tools - so I thought I'd reach out.  Any help you could give me would be appreciated.  Thanks!

chriscammers
Partner - Specialist
Partner - Specialist

@Steve_Rosebrook you are likely looking to use the "app script set" command in the the cli https://qlik.dev/toolkits/qlik-cli/app/app-script-set/

the example shows using a qvs file as the new script.

Steve_Rosebrook
Contributor II
Contributor II

Thanks @chriscammers.  I should have mentioned that I'm using the Windows client-managed version of Qlik - not Qlik SaaS.  Does the link you shared work for client-managed?  I tried that code and it's giving me an error so I wanted to check.

chriscammers
Partner - Specialist
Partner - Specialist

The documentation says Qlik Cli supports client managed and saas deployments. I realize concepts like spaces would not be a thing in client managed but the only thing you can do is try it out.

Please let us know how it goes.

Steve_Rosebrook
Contributor II
Contributor II

I am able to use CLI on our client-manager version of Qlik.  However, I think the syntax/functions/cmdlets must be different between the SaaS version of CLI and the client-managed version.  Here's the error message I get when trying to use the "qlik app script set" command:

Steve_Rosebrook_0-1720643466816.png

 

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

There are two things named "Qlik-CLI".

1) Original "qlik-cli" https://github.com/ahaydon/Qlik-Cli-Windows a powershell module for client-managed. You can likely set the script on client managed using this one. 

2) New qlik-cli https://qlik.dev/toolkits/qlik-cli/ for Qlik-SaaS and some client-managed functions. 

-Rob