animesh - i need some help in updating the para...

i need some help in updating the parameters on embeded liveboard. I have the below piece of code to update parameters.
const handleRenderedLiveboard = useCallback(async () => {
const parametersData: ThoughtspotParametersDataResponse = await liveboardRef.current?.trigger(
HostEvent.GetParameters,
);
const hasCurrencyCodeParameter = parametersData?.parameters?.some(
(parameter) => parameter.name === 'Currency Code',
);
if (hasCurrencyCodeParameter) {
await liveboardRef.current.trigger(HostEvent.UpdateParameters, [
{ name: 'Currency Code', value: loggedInUserLegalEntityDetails?.billingCurrency ?? 'USD' },
]);
}
}, [liveboardRef, loggedInUserLegalEntityDetails?.billingCurrency]);
const handleRenderedLiveboard = useCallback(async () => {
const parametersData: ThoughtspotParametersDataResponse = await liveboardRef.current?.trigger(
HostEvent.GetParameters,
);
const hasCurrencyCodeParameter = parametersData?.parameters?.some(
(parameter) => parameter.name === 'Currency Code',
);
if (hasCurrencyCodeParameter) {
await liveboardRef.current.trigger(HostEvent.UpdateParameters, [
{ name: 'Currency Code', value: loggedInUserLegalEntityDetails?.billingCurrency ?? 'USD' },
]);
}
}, [liveboardRef, loggedInUserLegalEntityDetails?.billingCurrency]);
in the above code as soon as the liveboard has rendered i am trying to programatically override the parameters only once. Post that, my users are not able to override the parameters by interacting with UI. even if the labels are changing. but the numerical values are not. any help will be highly appreciated.
3 Replies
shikharTS
shikharTS4mo ago
Again from the older thread, why do you think the numerical values will update? Have you added logic to change numerical values if parameter is updated?
animesh
animeshOP4mo ago
it does change on thoughtspot. and also on my local when i remove the logic to fire UpdateParameter event on local. and i haven't put any code to update the numerical values.
shikharTS
shikharTS4mo ago
Lets get on a call

Did you find this page helpful?