Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
How to get current selections in real time in Nebula.js, in Capability API I can use app.getList('SelectionObject',callback). Is there some alternative in Nebula?
Thanks in advance
Hello @sanekagr2 ,
Capability API is a bit more robust than Nebula. Nebula is only used for embedding Qlik objects. For everything that is outside of actually embedding (session management, hyperCubes, lists, passing selections, evaluating expressions etc.), you will need to directly interact with the QIX engine, via Enigma.js .
To get currentSelections the "Engima" way, you'll need to use the "CreateSessionObject" method and pass the "qSelectionObjectDef" object definition:
const selectionObj = await enigmaApp.createSessionObject({
"params": [
{
"qInfo": {
"qType": "CurrentSelection"
},
"qSelectionObjectDef": {}
}
]
});
const selections = await selectionObj.getLayout();
console.log(selections);
Hope it helps
Hello @sanekagr2 ,
Capability API is a bit more robust than Nebula. Nebula is only used for embedding Qlik objects. For everything that is outside of actually embedding (session management, hyperCubes, lists, passing selections, evaluating expressions etc.), you will need to directly interact with the QIX engine, via Enigma.js .
To get currentSelections the "Engima" way, you'll need to use the "CreateSessionObject" method and pass the "qSelectionObjectDef" object definition:
const selectionObj = await enigmaApp.createSessionObject({
"params": [
{
"qInfo": {
"qType": "CurrentSelection"
},
"qSelectionObjectDef": {}
}
]
});
const selections = await selectionObj.getLayout();
console.log(selections);
Hope it helps
@rankassovitz suggested the correct approach. This is the way.
Thank you for the fast response, I will try this solution.
Maybe you know some example of using Enigma.js in Angular application?
Here's a good open source Angular.io example:
https://github.com/yianni-ververis/nebula-angular
- look at globals.ts, you'll see how he authenticated (to a saas tenant) and got his enigma app (doc).
For more, framework agnostic, enigma.js examples check here:
https://github.com/qlik-oss/enigma.js/tree/master/examples
Thanks. Your solution worked:
const selectionObj = await app.createSessionObject({ "qInfo": { "qType": "CurrentSelection" }, "qSelectionObjectDef": {} }).then((model) => model); selectionObj.getLayout().then((layout) => { console.log('selectionObj', layout); });
Do you know the way to get the real time selection change indication in Enigma?
Thanks for the solution, i have been looking for this!
But reading the documentation of the enigma-api: Qix JSON-RPC | Qlik Developer Portal
It is hard to understand it is possible to do this, is there anywhere one may find information about what types "qType" can be in this case, and that :
"qSelectionObjectDef": {}
is a viable input to this method is also unclear.