Skip to main content

Integration, Extension & APIs

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

Showing results for 
Search instead for 
Did you mean: 
Partner - Contributor
Partner - Contributor

enigma.js getField method not working properly

Hey everyone,

I'm creating a bot service that communicates with the Qlik Engine API. The createSessionObject works fine and I can ask for measures constrained by dimensions, but I've been trying to call methods that select fields that seem to be not working. Namely, the "clearAll" method or the "getField".

When I call the "clearAll" from an opened app the fields that are selected aren't cleared, and with the "getField" I cannot perform selects over it.

The app is being properly opened as I can run the "createSessionObject" properly, but the other mentioned methods just don't work properly.

Has anyone ran over this same issue?




Labels (3)
2 Replies

Hi Tiago,

Maybe the field name is wrong or similar - when using getField and the Engine does not find that field, you should get (If I remember right) - the promise

  qHandle: null,
  qType: null

And even though the filed is not found, with enigmsjs, you will still get all the field methods ('clearAll', etc...)

You should check also your websocket communication with the app


Partner - Contributor
Partner - Contributor

Hi Aaz,

Thanks for the response.

The field is correct, it works when I try over the Engine API Explorer, and I've checked it over and over again.

I can use the 'createSessionObject' successfully and I call the "getField" method the following way:

let qField = await this.qApp.getField('MONTH');

Which returns the following object:

_events:Object {closed: }
addListener:function (type, listener) { … }
emit:function (type) { … }
listeners:function (type) { … }
on:function (type, listener) { … }
once:function (type, listener) { … }
removeAllListeners:function (type) { … }
removeListener:function (type, listener) { … }
session:Session {apis: ApiCache, config: Object, intercept: Intercept, …}
setMaxListeners:function (n) { … }
__proto__:Object {getCardinal: , getAndM

then I can call any field method, but with no success, i.e.:

let result = await qField.selectAlternative();

The 'result' variable evaluates to 'true', but nothing happens on the Qlik Sense sheet.


Also, when I call the 'ClearAll' method on the Doc class, nothing happens and the dimensions I have applied on the Qlik Sense sheet aren't cleared. However, it does work on the Engine API Explorer.

Am I missing something regarding how to select/clear fields?