Hi, we are using TS embedded in our
Hi, we are using TS embedded in our application, and we're facing issues with updating filters programmatically after the liveboard has loaded. We utilize
HostEvent.UpdateFilters
for this purpose, but the problem is that triggering it on the EmbedEvent.LiveboardRendered
event doesn’t update the liveboard because the charts aren’t completely loaded yet. Consequently, we have resorted to using setTimeout
to delay the UpdateFilters process, which is not an ideal solution. The time needed for the timeout varies and can lead to errors in some cases (Please check the code snippet below).
I’m wondering if there’s an event that indicates when the liveboard, including all charts and contents, is fully loaded. Alternatively, are there any other solutions to address this issue?
8 Replies
checking
Maybe you can use this embed event? https://developers.thoughtspot.com/docs/Enumeration_EmbedEvent#_data to see when the data is loaded for the liveboard embed?
EmbedEvent
Event types emitted by the embedded ThoughtSpot application.
Let me check if there are better ways to do this
Also maybe you can use init with runtime filters for your use-case?
Yea I tried that before. When using
EmbedEvent.Data
it keeps updating the filter and never stops
runtime filters doesn't work in this case since it filters the whole data so other values in the filter won't be available for users after that. We need to select one value in the filter and have other values available for users to selectYeah I think just listen for the first data event and then update filters and stop listening. Since data event is emitted on every data load, if you keep listening to it, it will update filters, fire a new data call and then update filters again going in an endless loop
Yea let me try it
I updated my code to this and seems to be working well:
Yes this looks good.
Thank you!