> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.textit.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Limiting the Number of Incorrect Responses to a Question

You may want to set a limit to the number of times a contact can respond to a specific question in your flow, such as with a quiz or survey. You can do this by using the `@node.visit_count` expression within a **Split by Expression** action.

In the example below, we've created a very simple quiz. We want the contact to have limited opportunities to answer the question, so we will place the `@node.visit_count` expression on a 'Split by Expression' node to limit the number of guesses.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/a/9/f/7a9fc4558a9de000/screenshot-2026-04-28-at-60720_1qjpxun.png)



In the flow above, we see that after collecting the contact's response with a 'Wait for Response', we're evaluating their answer with a 'Split by Expression'. Since we only want to give the contact two opportunities to answer correctly, here's how we've written the expression and rule:

![](https://storage.crisp.chat/users/helpdesk/website/-/7/a/9/f/7a9fc4558a9de000/screenshot-2026-04-28-at-60517_4z6e0j.png)


We've used the expression `@node.visit_count` and then written a rule with `has a number above 1` since they've already used their one other attempt in the previous 'Wait for Expression', equaling **two** total attempts.

What this means is that if they've answered correctly on their first try, they'll be routed through the 'Correct' exit on the 'Wait for Response' node and get a congratulatory message. If they get their first try wrong, they'll be routed through the 'Other' exit where we've set a limit to the number of times the contact can be wrong. Because the visit count is set to a number above 1, no further attempts are permitted.

We can see how this works via the [Simulator](https://help.textit.com/en/article/using-the-simulator-fqj21j/). This contact gave an incorrect response on their first attempt and was given a second and final opportunity to answer correctly. Because we set a `@node.visit_count` limit of `above 1` via a 'Split by Expression' node, their second incorrect answer means they've used up all their tries.

![](https://storage.crisp.chat/users/helpdesk/website/-/7/a/9/f/7a9fc4558a9de000/screenshot-2026-04-28-at-60643_1l7b6ye.png)


Another contact, however, studied a bit harder:

![](https://storage.crisp.chat/users/helpdesk/website/-/7/a/9/f/7a9fc4558a9de000/screenshot-2026-04-28-at-60612_u5sb5q.png)


Notice that in our follow-up message, we've referenced the number of tries the contact has made. We did this by using the same expression written as `@node.visit_count/2`. This would be especially useful if the contact had even more chances to respond correctly so they know how many opportunities remain.

Keep in mind that `visit_count` reflects only the current flow run. This means that if the contact is restarted in the flow, the count goes back to zero as counts from previous runs are not saved.

Try building your own flow logic to test this out! Questions? Send us a message via the support widget in the bottom right corner of your browser.