Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I'm absolutely new in this technologies and I'm trying work with Qlick Sense 3.0 programmatically.
I created application like on video from youtube:
https://www.youtube.com/watch?v=xT0KPWtrgMg
And now my purpose is to get/set selections programmatically.
To do this, I created extension and added it on sheet.
When sheet is updating, my method executing.
And my question is:
What should i do to get selected id or value in browser console?
What i made:
I've selected some fields:
And next, i'm wrote code:
define( [ "qlik"],
function ql(qlik) {
function myFunction(){
var app = qlik.openApp('Auto.qvf');
app.getList('CurrentSelections', function(reply){
console.log(reply);
});
}
return {
paint: function ($element) {
myFunction();
return qlik.Promise.resolve();
}
};
} );
But, in result, I'm always receiving an empty array.
How to do it right?
Please Assist.
Yes, i read topics before create new.
Thanks.
You can probably use var app = qlik.CurrApp(); instead of specifying the app name to start if this is an embedded extension object. Then, I referred to this documentation: Current selections ‒ Qlik Sense. But I can't seem to get it to work... let me know if you have any luck instituting the foreach.
var currentSelection = App.GetCurrentSelection();
foreach (var selectedField in currentSelection.selections) {
alert("Field: " + selectedField.Field);
alert("Selected values : " + selectedField.Selected);
}
You can probably use var app = qlik.CurrApp(); instead of specifying the app name to start if this is an embedded extension object. Then, I referred to this documentation: Current selections ‒ Qlik Sense. But I can't seem to get it to work... let me know if you have any luck instituting the foreach.
var currentSelection = App.GetCurrentSelection();
foreach (var selectedField in currentSelection.selections) {
alert("Field: " + selectedField.Field);
alert("Selected values : " + selectedField.Selected);
}
Thanks, Tim!
Looks like solution found.
I will wrte solution after tests
It Works!
define( [
'qlik'
],
function (qlik) {
function myFunction(){
var app = qlik.currApp();
app.getList("SelectionObject", function(reply){
// console.log(reply);
var str = "";
$.each(reply.qSelectionObject.qSelections, function(key, value) {
console.log(value.qSelected);
});
});
}
return {
paint: function ($element) {
myFunction();
return qlik.Promise.resolve();
}
};
} );
___
Teis, thanks for pm
If your question is now answered, please flag the Correct Answer (via the big "Correct Answer" button near every post) and Helpful Answers (found under the Actions menu under every post).
If not, please make clear what part of this topic you still need help with .