Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I'm new to building extensions and I'm wondering in what way it would be possible to store a value from an input field, so that when the extension is rendered by the paint function, the value won't be overwritten/reset. Meaning, in what way can I create a global variable that will not be reset once the paint function is called? Or if it is possible to declare a custom initialProperty that I can set and get in the paint function?
I've looked through some documentation but cannot seem to find a solution to my specific problem...
Any help would be greatly appreciated, and just let me know if further explanation is needed!
Yes I'm referring to that.
More specifically, inside your extension code you can access to Engine API starting from qlik object:
await qlik.currApp().model.enigmaModel.waitForOpen
await qlik.currApp().model.enigmaModel.getVariableById('_yourVariableId_')
const variable = await qlik.currApp().model.enigmaModel.getVariableById('_yourVariableId_');
await variable.setStringValue('test')
You could use Capability APIs for doing the same thing (here the get content and here to set a content) but with Engine APIs will work for both Capability and nebula.js approach.
As reference below Engine APIs documentation for methods mentioned above
You can use Qlik Sense variables for getting/setting values and then render variables' values into your extension input field.
For having a default value always rendered by your extension, create a variable in QlikSense with the default value and then render it into your input field.
You can use Engine API in extension code for getting/setting Qlik Sense variable values
Is this the documentation you're refering to: https://help.qlik.com/en-US/sense-developer/August2022/Subsystems/EngineAPI/Content/Sense_EngineAPI/... ?
Yes I'm referring to that.
More specifically, inside your extension code you can access to Engine API starting from qlik object:
await qlik.currApp().model.enigmaModel.waitForOpen
await qlik.currApp().model.enigmaModel.getVariableById('_yourVariableId_')
const variable = await qlik.currApp().model.enigmaModel.getVariableById('_yourVariableId_');
await variable.setStringValue('test')
You could use Capability APIs for doing the same thing (here the get content and here to set a content) but with Engine APIs will work for both Capability and nebula.js approach.
As reference below Engine APIs documentation for methods mentioned above