{"id":989,"date":"2022-09-09T11:44:27","date_gmt":"2022-09-09T09:44:27","guid":{"rendered":"https:\/\/support.botnation.ai\/how-to-manage-the-wrong-entry-of-an-email-or-a-number\/"},"modified":"2026-01-02T15:27:36","modified_gmt":"2026-01-02T14:27:36","slug":"how-to-manage-the-wrong-entry-of-an-email-or-a-number","status":"publish","type":"support","link":"https:\/\/botnation.ai\/en\/support\/how-to-manage-the-wrong-entry-of-an-email-or-a-number\/","title":{"rendered":"How to manage the wrong entry of an email or a number"},"content":{"rendered":"<p>Handling a variable type error for the<a href=\"https:\/\/botnation.ai\/fr\/support\/entree-utilisateur\/\">\u201cUser input<\/a>\u201d feature<\/p>\n\n\n\n\n\n<p>When you choose the variable type \u201c<strong>Email entry<\/strong> \u201d or \u201d <strong>Digit entry<\/strong>\u201c, if the answer entered by the user does not match the corresponding type, the chatbot considers it an error and will replay the sequence to ask the question again. However, in terms of user experience, it is very frustrating to be asked the same question over and over again without any explanation.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2022\/09\/image-166.png.webp\" alt=\"\" class=\"wp-image-993\"><\/figure>\n<\/div>\n\n\n<p>In this tutorial we will deal with this situation.<br><strong>Our goal is to display an explanatory text in case of an error.<\/strong><\/p>\n\n\n\n<p>We know that in case of error the sequence is replayed, so we must find a way to display a different text depending on whether it is the first time the question is asked or if it is the second.<br><br>This is possible by using the following two features:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/botnation.ai\/en\/support\/increment-decrement-the-value-of-a-variable\/\">Incrementing a variable<\/a><\/li><li><a href=\"https:\/\/botnation.ai\/en\/support\/the-if-condition-feature\/\">Condition on a variable<\/a><\/li><\/ul>\n\n\n\n<p>We start by creating a variable \u201cEmail_pass\u201d whose value will increase by 1 at each passage on the sequence.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2022\/09\/image-167.png.webp\" alt=\"\" class=\"wp-image-996\"><\/figure>\n<\/div>\n\n\n<p>So at the first pass this variable will take the value 1 then 2 or more if the user makes multiple errors.<\/p>\n\n\n\n<p>Now we need to create a condition that will change the text of the question depending on the number of passes.<\/p>\n\n\n\n<p>The condition must be configured as follows:<br><strong>IF <\/strong>the variable \u201cEmail_pass\u201d is equal to 1<br><strong>THEN<\/strong> we will assign the value \u201cPlease enter your email:\u201d to the \u201cEmail_text\u201d variable (valid for the 1st pass)<br><strong>OR <\/strong>we will assign the value \u201cAttention, please enter an email like martin@gmail.com:\u201d to the variable \u201cTexte_email\u201d (valid for all other passages)<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2022\/09\/image-168.png.webp\" alt=\"\" class=\"wp-image-998\"><\/figure>\n<\/div>\n\n\n<p>Then we use the \u201cEmail_text\u201d variable to ask the question in the \u201cUser input\u201d feature. Thus, the question will be asked differently depending on whether it is the first time or the following ones.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2022\/09\/image-169.png.webp\" alt=\"\" class=\"wp-image-1000\"><\/figure>\n<\/div>\n\n\n<p>This is what\u2019s its like for the user :<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/botnation.ai\/wp-content\/uploads\/2022\/09\/image-170.png.webp\" alt=\"\" class=\"wp-image-1002\"><\/figure>\n<\/div>\n\n\n<p><strong>You can adapt this tutorial to the detection of a number, it is the same mechanics.<\/strong><\/p>\n\n\n\n<p><\/p>\n\n\n","protected":false},"featured_media":0,"template":"","meta":{"_acf_changed":false},"categorie-support":[198,221],"class_list":["post-989","support","type-support","status-publish","hentry","categorie-support-tutorials","categorie-support-web-chatbot-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support\/989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/types\/support"}],"wp:attachment":[{"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/media?parent=989"}],"wp:term":[{"taxonomy":"categorie-support","embeddable":true,"href":"https:\/\/botnation.ai\/en\/wp-json\/wp\/v2\/categorie-support?post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}