Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Highlighted
Partner
Partner

Sense API: Loop over values in a field and perform action

Hi,

With my Javascript extension, I want to loop over a field (i.e. select each value in a field one by one) and then perform an after selecting a value. So, select a value, perform an action, and after finishing this action, the next value should be selected.

I can select a value using the select method of the Field API. However, I don't know how to get all (possible) values of a field.

So my question: how can I do this? I can imagine I need to fetch the possible values? Or is another method recommended for this problem?

Thanks!

Tags (1)
2 Replies
Partner
Partner

Re: Sense API: Loop over values in a field and perform action

A bump to make this post a little bit more visible. Is someone able to help me out?

Partner
Partner

Re: Sense API: Loop over values in a field and perform action

I also failed to call Capability api, I managed to call only QRS api. Example below: (node js)

var https = require('https');
var fs = require('fs');

var options = {
    hostname: 'demo.test.kz',
    port: 4242,
    path: '/qrs/app/full?xrfkey=0MwkYLXpxHrbkKGu',
    method: 'GET',
    headers: {
        'x-qlik-xrfkey' : '0MwkYLXpxHrbkKGu',
        'x-qlik-xrfkey' : '0MwkYLXpxHrbkKGu',
        'X-Qlik-User' : 'UserDirectory=internal; UserId=sa_repository'
    },
    key: fs.readFileSync("C:\\Users\\...\\client_key.pem"),
    cert: fs.readFileSync("C:\\Users\\...\\client.pem"),
    ca: fs.readFileSync("C:\\Users\\...\\root.pem")
};
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
https.get(options, function(res) {
    var bmpString = "";
    res.on("data", function(data) {
        bmpString += data;
    });
    res.on("close", function() {
      console.log(bmpString)
    });
}).on('error', function(e) {
    console.log("Got error: " + e.message);
});