Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Employee
Employee

How to change a extension setting

Dear colleagues

Is it possible to modify the extension settings without using the extension object properties panel?, and then persist the new values (do not disappearing when clicking on F5)?

I just need a basic example about how to:

- show a button on the front end (not extension properties panel)

- click on a button and then modify one extension setting (just will make sense if you are on Edit mode)

 

This seems easy but I can't find any example. 

I tryed a basic

layout.myProperty = true; in my js code

This just modify the properties temporarily but the new value does not persist.

 

Thanks for your help!

2 Solutions

Accepted Solutions
Employee
Employee

Re: How to change a extension setting

Hi

Nice plugin, very useful, it worked for me, the right path/code was:

this.backendApi.applyPatches([
{
"qPath": "/buttons/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

It changes the value of the setting, but unfortunately it loops, and repeats the process continuously.

Any experiences with this issue?

Regards

ErikWetterberg
Honored Contributor

Re: How to change a extension setting

Are you doing this in the paint method? Perhaps you should check that the property does not already have the correct value? Or perhaps you should do it when the user clicks on a button, meny etc.

6 Replies
ErikWetterberg
Honored Contributor

Re: How to change a extension setting

Employee
Employee

Re: How to change a extension setting

Hi Erik

 

Thanks, I believe I'm in the right path. But there are no good examples.

 

Could you help, I'm trying to modify the property 'dimfields' of an extension:

layout.backendApi.applyPatches([
{
"qPath": "/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

 

When I type the this code, nothing happens.

Is it just a question about the qPath ? if the answer is yes, how can I find the right path ?

 

Thanks again!

Highlighted
ErikWetterberg
Honored Contributor

Re: How to change a extension setting

Hi,

You can check the properties in the developer meny. Or you could use the Chrome extension I have developed:

https://chrome.google.com/webstore/detail/add-sense/bbiljflfafkaejgdebbnmcohpidgkejj

Employee
Employee

Re: How to change a extension setting

Hi

Nice plugin, very useful, it worked for me, the right path/code was:

this.backendApi.applyPatches([
{
"qPath": "/buttons/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

It changes the value of the setting, but unfortunately it loops, and repeats the process continuously.

Any experiences with this issue?

Regards

ErikWetterberg
Honored Contributor

Re: How to change a extension setting

Are you doing this in the paint method? Perhaps you should check that the property does not already have the correct value? Or perhaps you should do it when the user clicks on a button, meny etc.

Employee
Employee

Re: How to change a extension setting

My blame, after applying the patches in the right event it works.

In the paint method, using an event when clicking a button.

 

Thanks a lot Erik!!