animesh - Hi Team, I am trying to make changes ...

Hi Team, I am trying to make changes to override the parameters in LiveboardEmbed by sending runtimeParameters. following are the two ways I have tried sending runtime Parameters:- 1. send runtimeParameters as props to the LiveboardEmbed react component.
<LiveboardEmbed
ref={ref}
liveboardId={liveboardId}
frameParams={liveboard_frame_params}
liveboardV2
visibleActions={isCustomReport ? CUSTOM_REPORTS_LIVEBOARD_VISIBLE_ACTIONS : LIVEBOARD_VISIBLE_ACTIONS}
runtimeFilters={runtimeFilters}
showLiveboardTitle={isCustomReport}
showLiveboardDescription={isCustomReport}
onAddToFavorites={handleAddToFavorites}
onSave={handleSave}
onMakeACopy={handleMakeACopy}
customizations={getThoughtspotLiveboardStyleCustomizations(palette)}
onLoad={onLoadLiveboard}
onLiveboardRendered={onLiveboardRendered}
runtimeParameters={[{ name: 'Currency Code', value: 'INR' }]}
/>
<LiveboardEmbed
ref={ref}
liveboardId={liveboardId}
frameParams={liveboard_frame_params}
liveboardV2
visibleActions={isCustomReport ? CUSTOM_REPORTS_LIVEBOARD_VISIBLE_ACTIONS : LIVEBOARD_VISIBLE_ACTIONS}
runtimeFilters={runtimeFilters}
showLiveboardTitle={isCustomReport}
showLiveboardDescription={isCustomReport}
onAddToFavorites={handleAddToFavorites}
onSave={handleSave}
onMakeACopy={handleMakeACopy}
customizations={getThoughtspotLiveboardStyleCustomizations(palette)}
onLoad={onLoadLiveboard}
onLiveboardRendered={onLiveboardRendered}
runtimeParameters={[{ name: 'Currency Code', value: 'INR' }]}
/>
2. By triggering UpdateParameters event at Liveboard load and Liveboard rendered.
await liveboardRef.current?.trigger(HostEvent.UpdateParameters, [{ name: 'Currency Code', value: 'INR' }]);
await liveboardRef.current?.trigger(HostEvent.UpdateParameters, [{ name: 'Currency Code', value: 'INR' }]);
But unfortunately both the solutions are not working. My goal is to override the default value(USD) of parameter called Currency Code to respective countries currency. Please have a look at the attached screenshot.
No description
13 Replies
shikharTS
shikharTS4mo ago
1. So runtime parameters do not override the parameter chips in the liveboard, but the data should be according to the runtime parameter. 2. Can you remove runtime parameters and the onLoad and just the on liveboard REndered function. This is working for me
export function MyLiveboardOne() {
const embedRef = useEmbedRef<typeof LiveboardEmbed>();

const { showModalContent } = useGlobalModal();
const { liveboardIdOne, hostEventParams, setFullConfig, embedConfig } =
useAppConfig();

const onLiveboardRender = async (payload) => {
console.log(payload);
if (embedRef.current) {
await embedRef.current?.trigger(HostEvent.UpdateParameters, [
{ name: "divide", value: "15" },
]);
}
};

return (
<>
<HostEventBar embedRef={embedRef} />
<div className="MyLiveboardOne">
<LiveboardEmbed
liveboardId={"id"}
onLiveboardRendered={onLiveboardRender}
ref={embedRef}
additionalFlags={{
overrideConsoleLogs: false,
"embed-hostEventParameterization": true,
}}
customizations={commonStyles}
{...(embedConfig?.liveboard || {})}
/>
</div>
</>
);
}
export function MyLiveboardOne() {
const embedRef = useEmbedRef<typeof LiveboardEmbed>();

const { showModalContent } = useGlobalModal();
const { liveboardIdOne, hostEventParams, setFullConfig, embedConfig } =
useAppConfig();

const onLiveboardRender = async (payload) => {
console.log(payload);
if (embedRef.current) {
await embedRef.current?.trigger(HostEvent.UpdateParameters, [
{ name: "divide", value: "15" },
]);
}
};

return (
<>
<HostEventBar embedRef={embedRef} />
<div className="MyLiveboardOne">
<LiveboardEmbed
liveboardId={"id"}
onLiveboardRendered={onLiveboardRender}
ref={embedRef}
additionalFlags={{
overrideConsoleLogs: false,
"embed-hostEventParameterization": true,
}}
customizations={commonStyles}
{...(embedConfig?.liveboard || {})}
/>
</div>
</>
);
}
Also please confirm if the SDK version is the latest and the TS version you are using as it is available only after 10.1 https://developers.thoughtspot.com/docs/Enumeration_HostEvent#_updateparameters
HostEvent
Event types that can be triggered by the host application to the embedded ThoughtSpot app.
shikharTS
shikharTS4mo ago
Also check if the reference is correct or not as I see the ref used in function and in the component are different
animesh
animeshOP4mo ago
I appreciate your assistance. The issue was related to the ref. A fresh perspective is always helpful. Key takeaway: AI is useful, but reviewing code thoroughly before using AI-generated snippets is essential. thanks @shikharTS
animesh
animeshOP4mo ago
@shikharTS this is updating the parameters but the numbers are not reflecting correctly on the liveboard. please have a look at the attached screenshots.
No description
No description
shikharTS
shikharTS4mo ago
Is the expectation to be converted to INR to USD currency? Why would the number change?
animesh
animeshOP4mo ago
when the liveboard is getting loaded for the first time. I have dispatched(triggered) HostEvent.UpdateParameters event to display currency according to users home location currency. All this is done programmatically. Post rendering of thoughtspot liveboard on UI. if the user wants to see the same report with the expenditure values in some different currency, then the user would do it through UI. that should interaction to change the currency via UI should work seamlessly. Unfortunately it is not working the parameter(currency) changes the label but the numeric values dont change.
shikharTS
shikharTS4mo ago
Is the expectation that it will show the spend in INR instead of in USD? That is 536K* (ussd to inr conversion rate)?
animesh
animeshOP4mo ago
can we get on a call? so that i can explain the issue?
shikharTS
shikharTS4mo ago
Can you please ask this on the in-app support, they should be able to assist you better. I am expecting the same behaviour occurs when you are trying through TS UI?
animesh
animeshOP4mo ago
not sure why doesn't this guy respond.
animesh
animeshOP4mo ago
No description
animesh
animeshOP4mo ago
he is the support for our company
shikharTS
shikharTS4mo ago
Can you ask in the ThoughtSpot app support chat? I do not think he is the support guy..

Did you find this page helpful?