Question T12999
Visible to All Users

survey onComplete detects if a rule "Complete Survey" has been executed

created 2 years ago (modified 2 years ago)

Hi,

I have a survey that contains dozens of questions. On multiple questions, I have a rule if a user chooses a specific option, the survey becomes completed!

How to distinguish the event when the survey has been completed when any of these rules have been executed vs the case when the survey has been completed normally without executing any of these rules?

Kind Regards,
Amro

Answers approved by surveyjs Support

created 2 years ago

Hello,
There is a boolean property options.isCompleteOnTrigger that you can use in survey.onComplete event.

Thank you,
Andrew
SurveyJS Team

    Show previous comments (1)

      We had this issue that has been fixed in the latest versions. Please use the latest released version.
      "onComplete" event fired twice if a "complete" trigger executes on the last page.

      Thank you,
      Andrew
      SurveyJS Team

        Hello Andrew,

        The options.isCompleteOnTrigger always returns false! if it is completed normally or on trigger! We use the pkg version 1.9.89

        Kind Regards,
        Amro

          Hello Amro,
          Indeed, it doesn't work. I found the reason: our unit tests do not reproduce the scenario correctly after we start to hide "Next" button and show "Complete" button when a complete trigger is going to be executed.
          Here is the PR that fixes it. The fix will be available next week.

          Thank you,
          Andrew
          SurveyJS Team