Triggering Logic Not Working As Expected

Hi Team,

We have been running into some issues regarding User Triggered Logic. We have long surveys broken up into parts to make them easier for participants to complete. We want the Part 1 user trigger to appear only as long as there is no answer to the final question in Part 1, and from then on all Parts to appear only if the final question (this is a single answer question with only one option at the end of each survey) to the previous Part is answered and the final question in the current Part is not. So we tried:
For Part 1 [Survey ID 7371] - NOT Q7371_2 == 1 and Q7371_2 != 1 and Q7371_2 <= 0
For subsequent parts (Part 2 as the example here but all others that followed had a similar structure) [Survey ID 7372] - Q7371_2 == 1 AND NOT( Q7372_3 ==1) and Q7371_2 == 1 AND Q7372_3 !=1.

All these attempts have Part 1 not showing up at all, and if we remove the logic, answer part one, then refresh the app, part 2 will display but will not disappear once the final question is answered. Can someone help to answer this?

Hey @gnperera

For part 1, can you try with the following:

NOT(Q7371_2 == 1 OR Q7371_2 != 1)

I checked the question and had only one answer with ID 1. So I’m not sure why you put Q7371_2 <= 0.

The last question for 7372 is QID 3. So can you use the following?

(Q7371_2 == 1 OR Q7371_2 != 1) AND NOT(Q7372_3 == 1 OR Q7372_3 != 1)

It basically says “the first survey has an answer AND the second survey does not have an answer”.

Let me know if it doesn’t work.
Mohammad

Thanks Mohammad,

It all works great, except that the last survey in the chain doesn’t disappear once it has been completed.
Do you have any idea why this is?

Thank you so much for the response and the help so far though!

Anytime, would be happy to help.

Can you tell me the criteria you are using for the last one?

Same structure as the last ones.
(Q7372_3 == 1 OR Q7372_3 != 1) AND NOT(Q7373_3 == 1 OR Q7373_3 != 1)
I used this on the 3rd survey I had been testing and the user trigger did not go away. However when I added a 4th and 5th survey using the same structure as you suggested, the 3rd one user trigger disappeared and those surveys appeared instead, and now it is the 5th survey user trigger that remains on the screen. Here is the specific logic for part 5 (7384 is part 4 and 7385 is part 5)
(Q7384_3 == 1 OR Q7384_3 != 1) AND NOT(Q7385_3 == 1 OR Q7385_3 != 1)

This is not as time sensitive a question, more so just one for my own curiosity as the study we wanted to start this week is set up now thanks to your advice from this morning and ready to go. They have made an adjustment in case the last survey continues to show.

I see. There is a tag in each question’s definition, in the JSON of the survey, called persisted. This tag instructs the app to keep a copy of the response, even after sending it to the server, so it can be used for criteria evaluation.

The server automatically processes the survey and adjusts this tag as needed. But the logic we have there is not covering all cases. So the server does not properly set this tag for the last survey. You can fix it manually by downloading the survey’s JSON, and then modifying it as follow:

{
    "question_type": "single_choice",
    "question_id": 3,
    "is_mandatory": false,
    "confirm_to_skip": true,
    "enabled": true,
    "question_content": "<p>Are you done with this survey?</p>",
    "answers": [
        {
            "answer_content": "Yes",
            "answer_id": 1,
            "enable_question": "",
            "next_page": -2,
            "answer_type": "text"
        }
    ],
    "persisted": false,
    "has_placeholder": false,
    "order_id": 3
}

To:

{
    "question_type": "single_choice",
    "question_id": 3,
    "is_mandatory": false,
    "confirm_to_skip": true,
    "enabled": true,
    "question_content": "<p>Are you done with this survey?</p>",
    "answers": [
        {
            "answer_content": "Yes",
            "answer_id": 1,
            "enable_question": "",
            "next_page": -2,
            "answer_type": "text"
        }
    ],
    "persisted": true,
    "has_placeholder": false,
    "order_id": 3
}

Notice I changed "persisted": false, to "persisted": true,. We should fix it on our end though to detect this case as well.

Thanks for pointing this out,
Mohammad

Thank you Mohammad,

I had one last concern, the logic works really well on the mobile platform however it seems to create an infinite loop on the web-app. Anyone accessing the survey from the computer app will keep getting Part 1 in an infinite loop instead of being pushed the newer parts of the survey.

Is the logic structure different between the phone app and web app?

Hey @gnperera

Sorry for the delay in reply. I registered as a dummy participant in the Study 788 using Ethica for Web, and went through Test Chain 1 of 3 to Test Chain 5 of 3, and at the end, the button disappeared. I believe the problem you had was that the button would not disappear correct?

Can you try it out again and let me know if the problem still exist? If yes, can you give me a more details description on how I can reproduce it?

Thanks

Hi Mohammad,
Sorry I didn’t get back to you sooner, but the web survey has started working since we spoke about the issue. I appreciate you looking into it but everything is triggering correctly now.

Glad to hear things sorted out.