Mark - Hey there, I raised a request back in Se...

Hey there, I raised a request back in September - my use case is that we are embedding the thoughtspot dashboards into an app our side and we are applying runtime filters we have it so users can apply/unapply filters on a liveboard When we set runtime filters to an empty array via
await this.thoughtSpotEmbed.trigger(HostEvent.UpdateRuntimeFilters, []);
await this.thoughtSpotEmbed.trigger(HostEvent.UpdateRuntimeFilters, []);
it seems to hang for about 30-40 seconds before it does anything and when it does the liveboard has still got the results of the last selected filters I was told instead to use
liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [{
columnName: 'filterColumnName',
operator: RuntimeFilterOp.EQ,
values: [] // eg: empty array to clear
}]);
liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [{
columnName: 'filterColumnName',
operator: RuntimeFilterOp.EQ,
values: [] // eg: empty array to clear
}]);
But this did not help it still hung and the filters were still there I've been asked to join this discord and ask questions here - thanks for any help
9 Replies
yuichirio_ha
yuichirio_ha2mo ago
Hey, the await this.thoughtSpotEmbed.trigger(HostEvent.UpdateRuntimeFilters, []); One itself Wouldn't take any-time and return. Can you tell anything specific what things are you passing in LiveboardEmbed itself? I can try to repro. Thanks. @Mark
Mark
MarkOP2mo ago
Nothing too wild I suspect I have a video that I'll share of the filters being slow
No description
No description
Mark
MarkOP2mo ago
yuichirio_ha
yuichirio_ha2mo ago
Hey thanks, It looks like the delay you’re seeing is happening because the Liveboard embed is being recreated each time the filters or config change. In your code, a new LiveboardEmbed instance is created inside renderLiveboard() whenever the filters update. When that happens, the existing iframe gets torn down and replaced with a new one, so any SDK call like await embed.trigger(...) made during that transition will wait until the new embed is ready — that’s why you notice the few-second delay between the console logs. To avoid this, you can keep the same LiveboardEmbed instance and use the SDK’s trigger('UpdateRuntimeFilters', ...) method to update filters dynamically, instead of re-creating the embed each time. This will prevent the delay and make the interaction much smoother.
Mark
MarkOP2mo ago
Hm I don't think that is the case - apologies we have this in Angular so I will be using the terminology of that framework - we have a Signal that is the filters, that is built into an effect - so when the filters signal changes we use the embed.trigger method we only create the LiveboardEmbed as part of the ngOnInit would it be a good idea to share a small repo zip so you can have a play around with it?
No description
yuichirio_ha
yuichirio_ha2mo ago
hey sure. instead can you add it on sandbox better. codesandbox it would be easier. downloads are a hassle.
Mark
MarkOP5w ago
This is esentially what we have I have placed the liveboard control in components/thoughtspot-liveboard.* and the calling code in liveboard.* you can ignore most everything else those are just what the template gave me hopefully it gives you an idea of what were trying to do 😬 https://codesandbox.io/p/devbox/stoic-sea-439455
yuichirio_ha
yuichirio_ha4w ago
Hey thanks, I checked on the sandbox only- can you try one thing - don't trigger until thoughtspotEmbed is available. CC: @jbc can you PTAL. I wasn't able to get to the issue.
Ruchi Anand
Ruchi Anand3w ago
Hi @Mark It seems the Host event call is timing out after 30 seconds. I assume your intended workflow is: 1. Render the Liveboard with predefined runtimeFilters. 2. When filters change in the UI, update the Liveboard’s runtime filters using Host Event. 3. If no filters are applied, send an event with an empty array []. 4. If filters are applied, send the corresponding filter values in the HE payload. To clear runtime filter, the provided solution is correct, you need to pass an empty values array rather than sending the empty array as payload: liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [{ columnName: 'filterColumnName', operator: RuntimeFilterOp.EQ, values: [] // empty array clears the filter }]); If this isn’t working, we should verify that the filter payload is structured correctly and that values is indeed being sent as an empty array [].

Did you find this page helpful?