Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
gabineaq
Partner - Contributor III
Partner - Contributor III

Retrieve the currently applied theme on Mashup not working

Hello everyone,

I'm trying to build a mashup that allows the user to cycle between the QlikSense apps and display the theme applied to the QlikSense app.

I can open the apps and cycle between them, however when I use the method app.theme.getApplied it always retrieves a JSON with the default theme (sense), although my custom theme is set in QlikSense.

var app = qlik.openApp(appId, config);

app.theme.getApplied().then(function(qtheme){
console.log(qtheme);
});

Using the qlik.getThemeList() method displays all the themes, including my custom themes, so I can confirm that my theme is properly installed.

Is there any other method I should be using or should I use the API in other way?

Thanks!

 

1 Solution

Accepted Solutions
Damien_Villaret
Support
Support

Hi  @Gabi 

@Nadia is correct. In a mashup, the theme always defaults to the Qlik Sense default theme, not the one applied inside the app in the hub.

Therefore you need to first apply the theme in the mashup ( qlik.theme.apply('themenameid'); ) to be able to get it with app.theme.getApplied()

As far as I am aware, there is no method directly available in the Capability APIs to fetch the theme applied in the hub. You would need to use the Engine API (GetObject()) to get the object of type "appprops" and perform a GetProperties() if you want to do that.

https://help.qlik.com/en-US/sense-developer/November2020/apis/EngineAPI/services-Doc-GetObject.html

You can use the browser devtools in the hub when viewing the app properties to understand what is the workflow.

If the issue is solved please mark the answer with Accept as Solution.

View solution in original post

5 Replies
NadiaB
Support
Support

Hi @gabineaq 

By any chance are you using qlik.theme.apply('themenameid');?

Please refer to the following documentation:

https://help.qlik.com/en-US/sense-developer/May2021/Subsystems/APIs/Content/Sense_ClientAPIs/Capabil...

Kind Regards.

 

Don't forget to mark as "Solution Accepted" the comment that resolves the question/issue. #ngm
gabineaq
Partner - Contributor III
Partner - Contributor III
Author

Hi @NadiaB,

Thank you for your reply. 

I'm trying to get the apps and their associated themes.  For example, in QlikSense App1 uses customTheme1, App2 uses customTheme2, App3 uses default theme. I can get the app, the objects, but I can't get the themes set by the admin in QlikSense.  Using app.theme.getApplied() always returns the default theme - sense, not my custom themes: customTheme2, etc.

I have consulted the linked documentation and according to it app.theme.getApplied() should get  the currently applied theme. As far as I understand, it should get the theme set by the user in QlikSense. 

I'll use qlik.theme.apply('themenameid'); after I will get the id of the theme associated to the application.

Thanks!

gabineaq
Partner - Contributor III
Partner - Contributor III
Author

Is there a way or API method that displays  the existing Apps and the themes associated with them?

Damien_Villaret
Support
Support

Hi  @Gabi 

@Nadia is correct. In a mashup, the theme always defaults to the Qlik Sense default theme, not the one applied inside the app in the hub.

Therefore you need to first apply the theme in the mashup ( qlik.theme.apply('themenameid'); ) to be able to get it with app.theme.getApplied()

As far as I am aware, there is no method directly available in the Capability APIs to fetch the theme applied in the hub. You would need to use the Engine API (GetObject()) to get the object of type "appprops" and perform a GetProperties() if you want to do that.

https://help.qlik.com/en-US/sense-developer/November2020/apis/EngineAPI/services-Doc-GetObject.html

You can use the browser devtools in the hub when viewing the app properties to understand what is the workflow.

If the issue is solved please mark the answer with Accept as Solution.
ajaykakkar93
Specialist III
Specialist III

Hi @Damien_Villaret ,

Can i get a example i have a task that is related to this 

need the applied theme ID from the application & apply it on my mashup
In mashup it returns : id"sense"
which is not the theme i have applied i have multiple applications linked, want to do di dynamically

app.theme.getApplied().then(function(qtheme){
console.log( 'Current theme' , qtheme);
});

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting