Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Hidden Script

Hello,

exist any possible use hidden script in Qlik Sense?

Regards.

1 Solution

Accepted Solutions
Not applicable
Author

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

View solution in original post

9 Replies
Michael_Tarallo
Employee
Employee

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

Regards,
Mike Tarallo
Qlik
Not applicable
Author

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
Author

Hi Lars,

you can give me example for this?

Regards.

Not applicable
Author

Any one?

Not applicable
Author

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
Creator
Creator

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

Michael_Tarallo
Employee
Employee

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

Regards,
Mike Tarallo
Qlik
vinodchowdaryg
Contributor
Contributor

Hi,

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

Regards,

Vinod Gadiputi

dongocduyen
Contributor
Contributor

Hi Lars-Göran Book,

Can you help me explain how it works

Please can you contact me via email: dongocduyen113@gmail.com

Best regards

Ngoc Duyen,