Re-prompting users after invalid inputUnable to get bot to initiate a dialog with the user at a particular point in the conversation, using 'Event' or 'FollowupEvent'. What's the solution?Facebook Messenger postback button NOT triggering Dialogflow Eventdialogflow (api.ai) intent redirection for translate webhookNumber input & validationDialogFlow NodeJs - Set Response Message after webhookClient.setFollowupEventDialogflow : display “processing” message on intents triggered by followup eventsRedirect user to the Default Welcome Intent when he says “cancel” or “exit”Remove DialogFlow response in web-hook fulfillmentIntent gets recognized correctly but finds entities only on second tryHow can I receive input from user without defining training phrases for Actions on Google

Multi tool use
Multi tool use

Why does independence imply zero correlation?

King or Queen-Which piece is which?

How do internally carried IR missiles acquire a lock?

Is there any proof that high saturation and contrast makes a picture more appealing in social media?

Counterfeit checks were created for my account. How does this type of fraud work?

How many people are necessary to maintain modern civilisation?

When Bnei Yisroel travelled in the midbar, what happened on Shabbos?

Is there a term for the belief that "if it's legal, it's moral"?

How could empty set be unique if it could be vacuously false

Explicit song lyrics checker

Umlaut character order when sorting

How did the Vostok ejection seat safely eject an astronaut from a sealed space capsule?

What was the flower of Empress Taytu?

Helping ease my back pain by studying 13 hours everyday , even weekends

Dmesg full of I/O errors, smart ok, four disks affected

How do I professionally let my manager know I'll quit over an issue?

Prisoner on alien planet escapes by making up a story about ghost companions and wins the war

Why isn't my calculation that we should be able to see the sun well beyond the observable universe valid?

I just entered the USA without passport control at Atlanta airport

What is the highest voltage from the power supply a Raspberry Pi 3 B can handle without getting damaged?

Draw a symmetric alien head

Print one file per line using echo

Where should a runway for a spaceplane be located?

In the US, can a former president run again?



Re-prompting users after invalid input


Unable to get bot to initiate a dialog with the user at a particular point in the conversation, using 'Event' or 'FollowupEvent'. What's the solution?Facebook Messenger postback button NOT triggering Dialogflow Eventdialogflow (api.ai) intent redirection for translate webhookNumber input & validationDialogFlow NodeJs - Set Response Message after webhookClient.setFollowupEventDialogflow : display “processing” message on intents triggered by followup eventsRedirect user to the Default Welcome Intent when he says “cancel” or “exit”Remove DialogFlow response in web-hook fulfillmentIntent gets recognized correctly but finds entities only on second tryHow can I receive input from user without defining training phrases for Actions on Google






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.



I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.



So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:



function getPasscode(agent) 
console.log(agent.parameters);
if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
// Reset passcode call
else
return new Promise((resolve, reject) =>
agent.add("Your codes don't match. Please try again.");
var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
resolve(output);
);




The bot outputs the text properly, but isn't triggering the event, as intended.



Am I missing something?










share|improve this question




























    0















    I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.



    I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.



    So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:



    function getPasscode(agent) 
    console.log(agent.parameters);
    if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
    // Reset passcode call
    else
    return new Promise((resolve, reject) =>
    agent.add("Your codes don't match. Please try again.");
    var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
    resolve(output);
    );




    The bot outputs the text properly, but isn't triggering the event, as intended.



    Am I missing something?










    share|improve this question
























      0












      0








      0








      I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.



      I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.



      So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:



      function getPasscode(agent) 
      console.log(agent.parameters);
      if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
      // Reset passcode call
      else
      return new Promise((resolve, reject) =>
      agent.add("Your codes don't match. Please try again.");
      var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
      resolve(output);
      );




      The bot outputs the text properly, but isn't triggering the event, as intended.



      Am I missing something?










      share|improve this question














      I'm setting up a reset password intent using Dialogflow, where I'm performing some validation via webhooks. Unfortunately, I'm not able to figure out how to reprompt the user in case of failed validation.



      I've tried to trigger the intent again using an event, but it doesn't seem to be working. I've also tried setting the same input contexts to trigger the intent again, but neither seem to work.



      So I've created 2 parameters within the intent, which are being filled via prompts, following which I am performing the validation. Here's the code:



      function getPasscode(agent) 
      console.log(agent.parameters);
      if(/^d6$/.test(agent.parameters.code1) && agent.parameters.code1 == agent.parameters.code2)
      // Reset passcode call
      else
      return new Promise((resolve, reject) =>
      agent.add("Your codes don't match. Please try again.");
      var output = JSON.stringify("followupEvent": "name": "GetPasscode", "data": )
      resolve(output);
      );




      The bot outputs the text properly, but isn't triggering the event, as intended.



      Am I missing something?







      dialogflow






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 6:51









      Saurav SircarSaurav Sircar

      909




      909






















          2 Answers
          2






          active

          oldest

          votes


















          0














          Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.



          So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.



          You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)






          share|improve this answer

























          • I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

            – Saurav Sircar
            Mar 25 at 8:21











          • Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

            – Prisoner
            Mar 25 at 11:28


















          0














          In your use-case, you do not need to call the event as per my understanding. Better way to do this is :



          • Set-up intent where you ask and confirm the password and store it

          • Validate this in your webhook

          Here is the pseudo code:



          if validationPassed 
          call your api to reset password
          send reset password confirmation output to user

          if validationFailed
          setup output context to ask-password intent again
          send output to user to re-enter the password



          As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.

          Hope it helps.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332542%2fre-prompting-users-after-invalid-input%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.



            So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.



            You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)






            share|improve this answer

























            • I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

              – Saurav Sircar
              Mar 25 at 8:21











            • Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

              – Prisoner
              Mar 25 at 11:28















            0














            Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.



            So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.



            You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)






            share|improve this answer

























            • I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

              – Saurav Sircar
              Mar 25 at 8:21











            • Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

              – Prisoner
              Mar 25 at 11:28













            0












            0








            0







            Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.



            So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.



            You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)






            share|improve this answer















            Remember that Intents represent what the user does and not what your action is trying to do. In general, you don't "trigger" an Intent - the user does.



            So if you're "reprompting" the user - send that prompt in your reply to them. Then make sure the Intent is setup to capture their reply. This may involve in your setting an Output Context to narrow which Intents are evaluated to consider the reply.



            You can't both send back a response and trigger an Intent with an event. Sending an event from your fulfillment is almost never needed and, when done, discards anything you may already have set for a response. All it does is cause the Intent with the event registered to it to be triggered. (Your code has two problems in this respect - you both try to send a response, and you're trying to send the followup event incorrectly.)







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 25 at 11:27

























            answered Mar 25 at 8:11









            PrisonerPrisoner

            37.7k43965




            37.7k43965












            • I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

              – Saurav Sircar
              Mar 25 at 8:21











            • Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

              – Prisoner
              Mar 25 at 11:28

















            • I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

              – Saurav Sircar
              Mar 25 at 8:21











            • Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

              – Prisoner
              Mar 25 at 11:28
















            I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

            – Saurav Sircar
            Mar 25 at 8:21





            I understand that, but events are used to trigger intents, with the necessary parameters right? So can't I call an event itself to re-prompt?

            – Saurav Sircar
            Mar 25 at 8:21













            Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

            – Prisoner
            Mar 25 at 11:28





            Intents don't "prompt" - they respond. In theory, you can trigger an event which would send the reply that an Intent does - but this doesn't mean "wait for the user to say something". I clarified my answer a bit.

            – Prisoner
            Mar 25 at 11:28













            0














            In your use-case, you do not need to call the event as per my understanding. Better way to do this is :



            • Set-up intent where you ask and confirm the password and store it

            • Validate this in your webhook

            Here is the pseudo code:



            if validationPassed 
            call your api to reset password
            send reset password confirmation output to user

            if validationFailed
            setup output context to ask-password intent again
            send output to user to re-enter the password



            As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.

            Hope it helps.






            share|improve this answer



























              0














              In your use-case, you do not need to call the event as per my understanding. Better way to do this is :



              • Set-up intent where you ask and confirm the password and store it

              • Validate this in your webhook

              Here is the pseudo code:



              if validationPassed 
              call your api to reset password
              send reset password confirmation output to user

              if validationFailed
              setup output context to ask-password intent again
              send output to user to re-enter the password



              As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.

              Hope it helps.






              share|improve this answer

























                0












                0








                0







                In your use-case, you do not need to call the event as per my understanding. Better way to do this is :



                • Set-up intent where you ask and confirm the password and store it

                • Validate this in your webhook

                Here is the pseudo code:



                if validationPassed 
                call your api to reset password
                send reset password confirmation output to user

                if validationFailed
                setup output context to ask-password intent again
                send output to user to re-enter the password



                As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.

                Hope it helps.






                share|improve this answer













                In your use-case, you do not need to call the event as per my understanding. Better way to do this is :



                • Set-up intent where you ask and confirm the password and store it

                • Validate this in your webhook

                Here is the pseudo code:



                if validationPassed 
                call your api to reset password
                send reset password confirmation output to user

                if validationFailed
                setup output context to ask-password intent again
                send output to user to re-enter the password



                As @Prisoner says, you do not trigger an intent, the user does. We do the processing and send the response once the intent is triggered.

                Hope it helps.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 27 at 8:13









                sid8491sid8491

                4,08131340




                4,08131340



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332542%2fre-prompting-users-after-invalid-input%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Z2Nbi,njO2dQA480tu7rMZlXKzvbA1MnqIdHYUabi9x68gkRPIP mIhEhQP2vzF0v Xg5Vnsng5WFKQHuCha0,EGfyJ tzSEw49ETN
                    I XMJoR OubKrK chrHlb9A7d5Mi,r2gydG,Gcy73HLo9zUUkJrs3kQZVYfdQctBR2o306JHKy,zmQGlb2HHbINamhv,02KQH0,xReGTg

                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    위키백과:대문 둘러보기 메뉴기부 안내모바일판 대문크리에이티브 커먼즈 저작자표시-동일조건변경허락 3.0CebuanoDeutschEnglishEspañolFrançaisItaliano日本語NederlandsPolskiPortuguêsРусскийSvenskaTiếng ViệtWinaray中文العربيةCatalàفارسیSrpskiУкраїнськаБългарскиНохчийнČeštinaDanskEsperantoEuskaraSuomiעבריתMagyarՀայերենBahasa IndonesiaҚазақшаBaso MinangkabauBahasa MelayuBân-lâm-gúNorskRomânăSrpskohrvatskiSlovenčinaTürkçe