Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
sile95
Contributor
Contributor

@qlik/react-embed initial selection issues

Hello i need some help integrating qlik into my react application.

I am using @qlik/react-embeed and everything is working fine but i have issues figuring out how to provide initialSelections in react-embeed.

For example:
I have a sheet with some chart and on my react-application when user clicks on a table row, i want to show him chart for that specific user, meaning i have to provide an initialSelection to my qlik sheet.

Now in the documentation i see it exists, but the example is in web-components, not react-embeed and i dont know how to integrate it in react

<qlik-initial-selections app-id="a51a902d-76a9-4c53-85d2-066b44240146">

<field state="comparison" name="Product Sub Group Desc" values="Hot Dogs;Fresh Fruit"></field>

<field state="comparison" name="AccountDesc" values="Sales;Cost of goods sold"></field>
</qlik-initial-selections>

 
Here is my current integration code:

import React from 'react';
import { QlikEmbed as QlikEmbedAnalytics, QlikEmbedConfig, HostConfig } from '@qlik/embed-react';

interface QlikEmbedProps {
appId: string;
sheetId: string;
}

const hostConfig: HostConfig = {
authType: 'Oauth2',
clientId: '<client-id>',
// clientSecret,
accessTokenStorage: 'session',
redirectUri: 'http://localhost:3000/oauth-callback.html',
// apiKey: import.meta.env.VITE_QLIK_API_KEY,
host: import.meta.env.VITE_QLIK_HOST,
};

const QlikEmbed: React.FC<QlikEmbedProps> = ({ appId, sheetId }) => {
return (
<QlikEmbedConfig.Provider value={hostConfig}>
<QlikEmbedAnalytics
ui="analytics/sheet"
context={{
interactions: { active: true, select: true, edit: false, passive: false },
}}
appId={appId}
sheetId={sheetId}
theme="WunderMobilityTheme"
/>
</QlikEmbedConfig.Provider>
);
};

export default QlikEmbed;
Labels (3)
1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

Hey @sile95 @vijaya6 , I can confirm that this is not available in qlik-embed-react, but since you can easily get access to the app object in React you can set a selection state using the qix api.

View solution in original post

3 Replies
vijaya6
Contributor II
Contributor II

Hi, 
I am also trying the same. are you using Qlik cloud platform or Qlik Enterprise edition.
Mine is May 2024 Enterprise version and I'm trying to integrate @qlik/embed-react.
My authentication model is ticket now (which is configured in QMC).
Currently we are not able to make a connection properly any help ?

alex_colombo
Employee
Employee

Hey @sile95 @vijaya6 , I'm checking internally if this is available in react library (to me, seems it is not). I'll let you know.

alex_colombo
Employee
Employee

Hey @sile95 @vijaya6 , I can confirm that this is not available in qlik-embed-react, but since you can easily get access to the app object in React you can set a selection state using the qix api.