Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

ift_isabelle
Contributor II

Qlik Mashup - Hide an HTML based on a variable in Qlik Sense

Hi,

I want to hide an option in my HTML menu based on a variable in Qlik Sense.

My variable name is Dashboard and it contains either an Y or an N. If it is a Y i want to show a specific page within my Dashboard.

I tried this: But it doesn't work. I call an other variable above this one and that one works. But i can't figure out why this one doesn't work.

Can you help me?

Thanks,

Kind regards,

Isabelle

app.createList({ "qFrequencyMode": "N", "qDef": { "qFieldDefs": ["DASHBOARD"]},

                               "qInitialDataFetch": [{"qHeight": 20,

                                                                         "qWidth": 1}], "qLibraryId": null

                                }, function (reply) {

                               var dashboard = value[0].qText;                                  

                               if (dashboard == 'Y')

                                   {

                               $("#menu-internet").hide();

                                  }

                              else

                                 {

                              $("#menu-internet").show();

                                 } });

2 Replies
erik_wetterberg
Honored Contributor

Re: Qlik Mashup - Hide an HTML based on a variable in Qlik Sense

Hi Isabelle,

I think you should try createGenericObject instead. Would be something like this:

app.createGenericObject( {

   dashboard: {

      qStringExpression: "=DASHBOARD"

   }

},   function ( reply){

  if(reply.dashboard === 'Y'){

    .....

  } else {

  }

});

I haven't actually tested this, so there could be syntax errors etc.

Hope this helps

Erik

Erik Wetterberg
https://extendingqlik.upper88.com/
Not applicable

Re: Qlik Mashup - Hide an HTML based on a variable in Qlik Sense

Have you actually console.logged()  the reply and checked that reply.dashboard returns a value?

Community Browser