Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Anonymous
Not applicable
Author

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