Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gtettamanti
New Contributor

How to select a value from filter with JavaScript

Hi all hope you're fine,


I'm new with Qlik sense and I'm with mashup editor trying to select a value from a filter object on page load through JavaScript like in the below image:

Untitled.png

I was trying by selecting it looking for an Id but I didn't found a way, I did some tests into document ready method but without luck.


Someone has an idea or help to achieve it?

Thank you!

1 Reply
ajaykakkar93
Contributor

Re: How to select a value from filter with JavaScript

Hi,

You Can tru using Field API.

app.getObject('CONTAINER ID','OBJECT ID').then(function(reply){

app.field('FIELDNAME').toggleSelect("FIELD VALUE", true);

});

This is a simpla example replace the Following

  • CONTAINER ID(DIV ID)
  • OBJECT ID(QS OBJECT ID)
  • FIELDNAME
  • FIELD VALUE TO BE SELECTED
Regards & Thanks,
Ajay Kakkar
ajaykakkar93@gmail.com
Community Browser