Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Hidden Script

Hello,

exist any possible use hidden script in Qlik Sense?

Regards.

1 Solution

Accepted Solutions
Not applicable

Re: Hidden Script

Hi,

If you use the Engine API or the .Net SDK you could obfuscate the script. By storing the script in a custom property and setting the script with an empty script. Note that when you need to reload you will have to set the script again. See code snippets how this can be done.

private void hideScript()

{

  var script = ActiveApp.GetScript();

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  prop.Set("HiddenScript", script);

  ActiveApp.SetAppProperties(prop);

  ActiveApp.SetScript(string.Empty);

  ActiveApp.DoSave();

}

private void reloadHiddenScript()

{

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  ActiveApp.SetScript(prop.Get<string>("HiddenScript"));

  ActiveApp.DoReload();

  ActiveApp.SetScript(string.Empty);

  ActiveApp.DoSave();

}

private void unhideScipt()

{

  var script = ActiveApp.GetScript();

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  ActiveApp.SetScript(prop.Get<string>("HiddenScript"));

  prop.Set("HiddenScript", string.Empty);

  ActiveApp.SetAppProperties(prop);

  ActiveApp.DoSave();

}

Best Regards

Lars-Göran Book

8 Replies
Employee
Employee

Re: Hidden Script

Hi Paulo,

Hidden script is not available in Qlik Sense, because of the nature of how the apps are created and published when using Qlik Sense Enterprise (server / online). (There is technically no reason to hide the script as access to the data load editor can be controlled with security rules and permissions)

Let me know if you need more information.

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

Not applicable

Re: Hidden Script

Hi,

If you use the Engine API or the .Net SDK you could obfuscate the script. By storing the script in a custom property and setting the script with an empty script. Note that when you need to reload you will have to set the script again. See code snippets how this can be done.

private void hideScript()

{

  var script = ActiveApp.GetScript();

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  prop.Set("HiddenScript", script);

  ActiveApp.SetAppProperties(prop);

  ActiveApp.SetScript(string.Empty);

  ActiveApp.DoSave();

}

private void reloadHiddenScript()

{

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  ActiveApp.SetScript(prop.Get<string>("HiddenScript"));

  ActiveApp.DoReload();

  ActiveApp.SetScript(string.Empty);

  ActiveApp.DoSave();

}

private void unhideScipt()

{

  var script = ActiveApp.GetScript();

  var prop = ActiveApp.GetAppProperties().As<NxAppProperties>();

  ActiveApp.SetScript(prop.Get<string>("HiddenScript"));

  prop.Set("HiddenScript", string.Empty);

  ActiveApp.SetAppProperties(prop);

  ActiveApp.DoSave();

}

Best Regards

Lars-Göran Book

Not applicable

Re: Hidden Script

Hi Lars,

you can give me example for this?

Regards.

Not applicable

Re: Hidden Script

Any one?

Not applicable

Re: Hidden Script

Hi Paulo,

I have posted an tool on Qlik Branch that you can use to hide scripts and reload hidden scripts.

See QlikSenseScriptObfuscater

Best regards

Lars-Göran Book

Sajid_Mahmood
Contributor

Re: Hidden Script

Hi Mike Tarallo

So where the security rules and permissions applied on the script at the server level. Can you please send the steps or provide the video link showing this setup.

Thanks

Regards

Sajid

Employee
Employee

Re: Hidden Script

Hi Sajid,

Note Lars example is for custom built apps and is not out of the box.

Out of the box, security rules are applied in the QMC. I have not recorded a video on this yet, but my colleague has - you can register for the free on demand webinar here:

Qlik Sense Security Rules: Centralized, Consistent & Accurate | Qlik

Note that rules are not really action specific and are not specific to the script / load editor - they are specific to the apps / objects and resources available to the user and roles / groups set in the rules you create. You can have a user have access to an app and create chart objects, but not access to the script etc.

Also check out the online help: http://help.qlik.com/sense/2.0/en-US/online/#../Subsystems/ManagementConsole/Content/design-access-c...

Please mark the appropriate replies as CORRECT / HELPFUL so our team and other members know that your question(s) has been answered to your satisfaction.

Regards,

Mike Tarallo

Qlik

vinodgadiputi
New Contributor

Re: Hidden Script

Hi,

Can any one explain me the procedure to use above script.

Regards,

Vinod Gadiputi