[SurveyJS For Reactive] Propagate changes from block to parent (different application)
Forge component by Francisco Silva
Application Type
Reactive

Hi,

I have some troubles with saving the answers given to a survey created with SurveyJS. 

Situation: 

Developed an application where users can request a review over a file. For this review there is a questionnaire available which has been created with SurveyJS and is stored as JSON in the SurveyJS application. I have consumed the needed entities and screens from this module to be able to display the Survey in my app. 

When I answer the questions and click save the answers are saved and stored in the SurveyJS module. (I can see this happening in the database or SurveyJS). To make sure that I can retrieve the answers as well I need to store the created answerId in my 'local' application. I tried using an event to push the newly created answer Id to my own application but it seems to be skipping this logic all together. 

Does anyone know how to handle this or if their might be another way to do this. 


I am also not sure if the current approach is in line with the best practices regarding the architecture of my application. It feels like there are side references between end user modules but on the other hand it is a completely different application. 


Regards,
Max

Hello, 

I see that the SurveyAnswer block sends an event after saving the answer with the SurveyAnswer Id.
Are you handling it on the parent?

You must create an action which will be the handler of the event, and there you can access the id that the SurveyAnswer block sent and save it on your db

Hi Vera,

The SurveyAnswers even is recognized by the application using the block and I can select a handler to add logic on what to do after the block. It is just that this logic that I have implemented seems to be skipped or so. I assume that is because the block is shown in another application. But I am not sure on how to handle this and make the logic execute with that SurveyAnswerId being pushed up.

The only thing I can think of is consuming the other applications core module and directly execute the logic there. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.