Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sanekagr2
Partner - Contributor III
Partner - Contributor III

Get current selections in Nebula.js

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

 
Labels (3)
1 Solution

Accepted Solutions
rankassovitz
Employee
Employee

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

View solution in original post

7 Replies
rankassovitz
Employee
Employee

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

Jeffrey_Goldberg
Employee
Employee

 @rankassovitz suggested the correct approach. This is the way.

sanekagr2
Partner - Contributor III
Partner - Contributor III
Author

Thank you for the fast response, I will try this solution.

sanekagr2
Partner - Contributor III
Partner - Contributor III
Author

Maybe you know some example of using Enigma.js in Angular application?

rankassovitz
Employee
Employee

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 

 

 

 

sanekagr2
Partner - Contributor III
Partner - Contributor III
Author

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?

 

Axel_K
Contributor
Contributor

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.