Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Trigger event after survey completed

  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203362 by marquartnicolas
Trigger event after survey completed was created by marquartnicolas
Hello, in limesurvey is there a native webhook or plugin configuration with events that is triggered when a person answers a survey?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
4 years 4 months ago #203368 by DenisChenu
Replied by DenisChenu on topic Trigger event after survey completed

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #203444 by holch
Replied by holch on topic Trigger event after survey completed
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.

The topic has been locked.
  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203452 by marquartnicolas
Replied by marquartnicolas on topic Trigger event after survey completed
Thanks, I have to see how to install the plugin but I see that it would be the solution that is needed.
The topic has been locked.
  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203453 by marquartnicolas
Replied by marquartnicolas on topic Trigger event after survey completed
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.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #203454 by holch
Replied by holch on topic Trigger event after survey completed
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.

The topic has been locked.
  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203455 by marquartnicolas
Replied by marquartnicolas on topic Trigger event after survey completed
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.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #203456 by holch
Replied by holch on topic Trigger event after survey completed
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.

The topic has been locked.
  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203460 by marquartnicolas
Replied by marquartnicolas on topic Trigger event after survey completed
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #203477 by tpartner
Replied by tpartner on topic Trigger event after survey completed
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.
The topic has been locked.
  • marquartnicolas
  • marquartnicolas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 4 months ago #203484 by marquartnicolas
Replied by marquartnicolas on topic Trigger event after survey completed
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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago - 4 years 4 months ago #203515 by tpartner
Replied by tpartner on topic Trigger event after survey completed
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:
Code:
{{ processString('{SID}') }}
Code:
{{ processString('{SAVEDID}') }}
Code:
{{ processString('{TOKEN}') }}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 4 months ago by tpartner.
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose