Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all ,
We are trying to create templates so end users can base their work on. We want him to choose between a set of scripts already written . Is their anyway to post a whole script to an existing app using api request ? We are using .net to develop the framework.
Hi @eazoury
You probably could use ODAG if the only that changes is the where clause ,as the odag will segreate according to selections
Qlik Sense in 60 - On Demand App Generation (ODAG)
https://www.youtube.com/watch?v=Ft3I00-g4H4
But if what you want is to have different scritps, you proabaly will need to duplicate the app and change the script
Copy App:
https://help.qlik.com/en-US/sense-developer/February2020/APIs/EngineAPI/services-Global-CopyApp.html
Set Script
https://help.qlik.com/en-US/sense-developer/April2020/APIs/EngineAPI/services-Doc-SetScript.html
You will probably need to change the owner if the API is not triggered with the user that needs access to the app, and also you will need to trigger a reload
Hope it helps.
Hi @eazoury
You probably could use ODAG if the only that changes is the where clause ,as the odag will segreate according to selections
Qlik Sense in 60 - On Demand App Generation (ODAG)
https://www.youtube.com/watch?v=Ft3I00-g4H4
But if what you want is to have different scritps, you proabaly will need to duplicate the app and change the script
Copy App:
https://help.qlik.com/en-US/sense-developer/February2020/APIs/EngineAPI/services-Global-CopyApp.html
Set Script
https://help.qlik.com/en-US/sense-developer/April2020/APIs/EngineAPI/services-Doc-SetScript.html
You will probably need to change the owner if the API is not triggered with the user that needs access to the app, and also you will need to trigger a reload
Hope it helps.
You can use App.SetScript in the .net sdk.
-Rob
Hi again,
Thanks for your reply it was very helpful.
I tried using the qlik engine and wrote some code here is how it looks like :
public Stream setScript(string appId , string script)
{
location.VirtualProxyPath = "https://sensetst:4747/engineapi/";
location.AsStaticHeaderUserViaProxyAsync("FR-MUREX-COM", "stat-hdr",false, false);
try
{
using (var app = location.App(location.AppWithId(appId), randomSession, null, true))// Location specified in Accessing
{
app.SetScript(script);
byte[] byteArray = Encoding.ASCII.GetBytes("ok");
return new MemoryStream(byteArray);
}
}
catch (MethodInvocationException e)
{
byte[] byteArray = Encoding.ASCII.GetBytes("Could not open app: " + Environment.NewLine + e.InvocationError.Message);
return new MemoryStream(byteArray);
}
catch (TimeoutException e)
{
byte[] byteArray = Encoding.ASCII.GetBytes("Timeout for: " + Environment.NewLine + e.Message);
return new MemoryStream(byteArray);
}
}
However opening the app : location.appwithid() is giving me a time out exception "Method "QTProduct" timed out"
Could it be a problem with the proxy configuration ?
If you connect via the Proxy
location.AsStaticHeaderUserViaProxyAsync
then your URI should be the proxy path -- same URL you use in the browser -- not the engine port.
-Rob
Hi @eazoury
By any chance have you seen this already ?
Kind Regards,