7 Replies Latest reply: Jul 29, 2015 8:35 AM by Michael Tarallo RSS

    Hidden Script

    Paulo Dantas

      Hello,

       

      exist any possible use hidden script in Qlik Sense?

       

      Regards.

        • Re: Hidden Script
          Michael Tarallo

          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

          • Re: Hidden Script
            Lars-Goran Book

            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