Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
ernstblaauw
Partner - Contributor III
Partner - Contributor III

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!

Labels (1)
  • API

2 Replies
ernstblaauw
Partner - Contributor III
Partner - Contributor III
Author

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

kassyernar
Partner - Contributor
Partner - Contributor

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);
});