Trigger event after survey completed

More
2 months 4 hours ago #203362 by marquartnicolas
Hello, in limesurvey is there a native webhook or plugin configuration with events that is triggered when a person answers a survey?

Please Log in to join the conversation.

LimeSurvey Partners
More
2 months 4 hours ago #203368 by DenisChenu

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203444 by holch
Either like Denis, or, for some approaches the END-URL (you can redirect the respondents to a given URL) feature might be enough.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203452 by marquartnicolas
Thanks, I have to see how to install the plugin but I see that it would be the solution that is needed.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203453 by marquartnicolas
Thanks, I see that this would be easier than installing the plugin, it had not occurred to me so I will keep it in mind.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203454 by holch
The AfterSurveyComplete event is not a plugin, it is an event that you could use in a plugin that you still have to write. So these are two different approaches to be able to do "something" after a survey is complete. Sometimes the end url calling an external script can do the trick, but in many cases it might not work and you need to go with the event mentioned by Denis.
Without know what you are trying to do at the end of the survey, we can only say what is there, but can not give any tips what would be best.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203455 by marquartnicolas
ok I understand.

The idea is to invite him to answer a survey and once he completes the survey synchronize the contact in an external system.

Today every hour I get the last hour of answers but I want something in real time.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203456 by holch
I think this can be done with the end url, depending on the target system. You can use Expression Manager in the end URL and you can pass on variables through this feature dynamically to your other system. But of course, you might not want to show the respondent the redirect, then you might have to do it differntly.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203460 by marquartnicolas
Ok, I think I understood, until now I had not used expression manager .. I was just reading a little, it seems super fast to solve it this way, although I still did not find what the name of the variables would be {sid} .. and the other I have to read the documentation more.

I also found this way that I would still have to learn to build the plugin medium.com/@evently/creating-limesurvey-plugins-adcdf8d7e334

Thanks for the attention.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203477 by tpartner
Or, if you don't want to redirect away from the end message, maybe insert an AJAX call to your remote script in the end message.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

More
1 month 4 weeks ago #203484 by marquartnicolas
Ok, what you mean is that he modify the submit.twig? I think the idea is good but how could I get the SurveyId and the ResponseId?

Once you have that data you can add an ajax to my api to sync that survey and that response.

Please Log in to join the conversation.

More
1 month 4 weeks ago - 1 month 4 weeks ago #203515 by tpartner
You can place the AJAX call in the survey end message instead of the theme TWIG file. That way you have direct access to the survey ID - "{SID}" - and the response ID - {SAVEDID} or {TOKEN}.

If placing it in submit.twig, try:
{{ processString('{SID}') }}
{{ processString('{SAVEDID}') }}
{{ processString('{TOKEN}') }}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Last edit: 1 month 4 weeks ago by tpartner.

Please Log in to join the conversation.

More
1 month 4 weeks ago #203524 by DenisChenu
ajax can be easily updated by user :)

s a matter of principle, I don't trust users:

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 3 weeks ago #203538 by tpartner
In the end message case, I intended that it can be updated by the survey admin in case there are other survey-specific variables to be passed in the AJAX call.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now