Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

anders_uddenber
New Contributor III

Is GetTablesAndKeys() broken?

I want to use the method GetTablesAndKeys and I'm doing this in my extension

var app = qlik.currApp(this);

if (typeof app.getTablesAndKeys === "function") {

   app.getTablesAndKeys(qWindowSize, qNullSize, 0, false, false).then(function(data) {

     console.log(data);

   });

  } else {

   console.log("GetTablesAndKeys not available on app");

  }

What I get is the error "GetTablesAndKeys not available on app" but it should be afaik.

Any idea what I'm doing wrong?

1 Reply
anders_uddenber
New Contributor III

Re: Is GetTablesAndKeys() broken?

Solved it but I'll leave a reply for anyone interested in this.

Turns out I tried to call getTablesAndKeys on "app" that I got from qlik.currApp(this).

What I had to do in my extension is to include engine, as such:

define( ["qlik", "jquery", "text!./style.css","core.models/engine"], function (qlik, $, cssContent, engine) {

Please note "core.models/engine" and then function(.... engine) {

Then I can do

var app = engine.currentApp;

app.getTablesAndKeys(...)

Turns out it's important to know which API is used where. Go figure

Community Browser