Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
ozcano
Contributor III
Contributor III

Using Qlik Sense .Net SDK to create a new app from existing: load script change and call to reload

Hello

By using Qlik Sense .Net SDK:

I created a new app from existing one,

then I changed the load script for new app,

and then I called to reload process for new app.

ozcano_5-1707384054407.png

But there are two problems

1- Although I can see from the logs under C:\ProgramData\Qlik\Sense\Log\Script that execution completed, the line myNewReload.Wait(); newer finishes, it simply waits as if it is not completed.

ozcano_2-1707383651754.png

2-Although I can see from the logs under C:\ProgramData\Qlik\Sense\Log\Script that load script has been correctly changed, the resultant application still contains old data. That is, not the new OrdererStoreCode (which is 57), but old one (which was 10). This is probably happening from the same reason as in the first problem above.

ozcano_4-1707383805831.png

Would you please help?

Regards, Ozcan

NOTE: The reason I am doing all these is: We have an app which contains billion+ rows and which works slow because of this large data (cannot reduce data for business reasons). We want to divide app into parts by branches. The problem is we have 100+ branches, so we need 100+ apps just for this app type. We do not have resources to manage so many applications manually. So if we can manage (create, load, publish etc.) all with Qlik Sense .Net SDK, it will be much easy.

Labels (1)
  • API

1 Solution

Accepted Solutions
Øystein_Kolsrud
Employee
Employee

Could it be that the new app is still saving, and that that is why the DoReload call hasn't completed yet even though the script indicates that it is done? Other than that, I don't see anything obviously wrong in your program.

But I would recommend that you use the Repository endpoints when doing operations such as app copy. The copy flow involves both the engine and the repository, so I'm not 100% sure the engine endpoint does everything you would expect. I have this library for doing REST calls to Qlik Sense that could be of interest to you since you're familiar with the .NET SDK:

https://www.nuget.org/packages/QlikSenseRestClient/

With that one, you can do an app copy through the Repository like this:

 

var restClient = new RestClient(location.ServerUri);
restClient.AsNtlmUserViaProxy(certificateValidation: false);
var newAppName = "MyAppCopy";
var newApp = restClient.Post<JObject>($"/qrs/app/{appId}/copy?name={newAppName}");
var newAppId = newApp["id"].Value<string>();

 

And then with that "newAppId" you can open it through the .NET SDK and do what you want in terms of script modification and reload. Of course, "newAppName" should be replaced according to your needs.

View solution in original post

1 Reply
Øystein_Kolsrud
Employee
Employee

Could it be that the new app is still saving, and that that is why the DoReload call hasn't completed yet even though the script indicates that it is done? Other than that, I don't see anything obviously wrong in your program.

But I would recommend that you use the Repository endpoints when doing operations such as app copy. The copy flow involves both the engine and the repository, so I'm not 100% sure the engine endpoint does everything you would expect. I have this library for doing REST calls to Qlik Sense that could be of interest to you since you're familiar with the .NET SDK:

https://www.nuget.org/packages/QlikSenseRestClient/

With that one, you can do an app copy through the Repository like this:

 

var restClient = new RestClient(location.ServerUri);
restClient.AsNtlmUserViaProxy(certificateValidation: false);
var newAppName = "MyAppCopy";
var newApp = restClient.Post<JObject>($"/qrs/app/{appId}/copy?name={newAppName}");
var newAppId = newApp["id"].Value<string>();

 

And then with that "newAppId" you can open it through the .NET SDK and do what you want in terms of script modification and reload. Of course, "newAppName" should be replaced according to your needs.