Unsaved State in Embed

Hi, I have embedded an answer using search embed and I have primary custom action on it for collecting some details from the user. When the user is editing that answer, how can we confirm whether the answer is saved or not when user initiated custom action? Is there any way to check if the answer is unsaved and force the user to save it
4 Replies
Justin Mathew
Justin Mathew13mo ago
Hey @Saravana can you try using hostEvents https://developers.thoughtspot.com/docs/Enumeration_HostEvent Can you check Edit and Save hostEvents that might help when Edit is triggered you can set the state as editing until save event is triggered the user will be in unsaved state. Might have to give it a try
HostEvent
Event types that can be triggered by the host application to the embedded ThoughtSpot app
Saravana
SaravanaOP13mo ago
Hi Justin. We are not triggering edit at anytime, Owner of the answer can revisit the saved answer using search embed and they can edit some columns and save it again. There is a primary custom action on the answer, so user can edit the answer and they might click on custom action even before saving it. So we would need to verify whether the answer has unsaved edits and force the user to save it. Then after saving , they can trigger the custom action. We have already tried using save host event on our custom action itself as the first step before doing its actual action. But the custom action is unable to do two actions at a time or sequence.
ashish
ashish13mo ago
You have a property called isAnswerUnsaved inside the custom action payload for a saved answer.
No description
Saravana
SaravanaOP13mo ago
This is what I was looking for. I was using the payload but didn’t notice this specific property which will identify if the answer is unsaved. Thanks Ashish

Did you find this page helpful?