Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Highlighted
bep
New Contributor

Sense Extension - Retrieve and paint object based on Object Id

Hey all,

I am new to extensions and have been experimenting and I am hoping there is a easy solution to my question. 

What I am trying to do is to render an existing object to the sheet based on that object's id. 

I have coded up a simple extension that will take in a object id as a parameter, I can programmatically retrieve the object Id but I can't figure out how to render it to the screen in the underlying java script.

Any guidance would be appreciated.

Tags (3)
1 Solution

Accepted Solutions
bep
New Contributor

Re: Sense Extension - Retrieve and paint object based on Object Id

So to answer my own question..  leverage the App API: qlik.app.getObject(elem, id, options)

Snippet highlighting key elements

var html = "<div id='vizId' style=...></div>";

var app = qlik.currApp(this);

...

app.getObject( "vizId", objectId );

...

$element.html( html );

More can be found here: API Reference

1 Reply
bep
New Contributor

Re: Sense Extension - Retrieve and paint object based on Object Id

So to answer my own question..  leverage the App API: qlik.app.getObject(elem, id, options)

Snippet highlighting key elements

var html = "<div id='vizId' style=...></div>";

var app = qlik.currApp(this);

...

app.getObject( "vizId", objectId );

...

$element.html( html );

More can be found here: API Reference