Hi
Chengcheng Zhang,
If the business wants # as terminating char then we have to use range to collect input (6 to 7) and as per the latest screen shot you are setting terminating DTMF as # and you are not including it on the result, so that means we have to check always caller input account number length is equal to 6. In case if the customer enter 1234567 it is also valid as per range, however, i'm sure that you have a check for input length and you are going back to collect the account number again. Here as per my understanding when we enter 1234567890, it is considering 1234567 as valid input and it will take success path, and here length is 7 and if you are going back to collect number again, then 890 will be considered as user input as second attempt, so it will wait for inter digit timeout (number of seconds) before it throws a nomatch, because the valid length is 6 or 7 digits. So, it will take the failure path in this case.
In case if you want to discard the excess digits when it got 7 or more digits in length then place a play audio task and add a blank 100 ms audio with unchecking the "Enable Barge-in" check box. this will discard or flush out the excess digits, and when we go back to collect account number state it will also play the prompt which is set and it will wait for your input.
Hope this explanation helps you to understand the scenario.
The fix you mentioned is also having similar issue when you enter more than 32 digits, i.e., if you enter 35 digits then 32 will be considered as input for the first time and the rest of 3 digits will be carried to next dialog state(i.e., either a menu or collect input task).
Here is the sample screen shot to show how to mimic the discarding excess digits:

Sample app flow :

------------------------------
Ramu P
Global Technology Solutions, LLC
------------------------------
Original Message:
Sent: 04-26-2022 20:37
From: Chengcheng Zhang
Subject: Collect Data function in Architecture
Hi Ramu
thank you so much for your reply.
account number was exactly 6 digits, but our business request is that allow user to end the input with #, so seems cannot set it to exactly 6 digits.
I did not understand what's your mean by saying rest of the digits will be carried to next states?
how to collect next states data? what was current status and next states ?
in this case, if user input 123456790, as you said, Genesys will consider the input as 1234567, but why and how it go to both success path and fail path ?
------------------------------
Chengcheng Zhang
FIL Fund Services (Bermuda) Limited
Original Message:
Sent: 04-25-2022 05:11
From: Ramu P
Subject: Collect Data function in Architecture
Hi Chengcheng Zhang,
If your account number is exactly 6 digits then i don't think it is necessary to collect 7 digits and even a pound(#). you can collect exact 6 digits and then move on with next state.
Regarding the input 1234567890, when we enter this input it will consider 1234567 as input to this dialog state and then rest of the digits will be carried to next states(because of key ahead option). Here is is accepting 7 digit length number because your grammar range is 6 to 7 digits in length. If you have any validation checks that validates your input then it might help check extra one digit other than (#)pound if you see it then you can consider it as a invalid entry, reset the successAccount variable with empty or NOT_SET and then go back to same state to collect the input again. It is not a bug, it is working as per the application design. If you do not want to consider excess digits then you can simply play a prompt with barge-in checked, then it will drop the excess digits.
Hope this helps.
------------------------------
Ramu P
Global Technology Solutions, LLC
Original Message:
Sent: 04-15-2022 02:08
From: Chengcheng Zhang
Subject: Collect Data function in Architecture
Hi
my business request was : collect user's account number which was six digit.
user can choose to press # to end the input of account number.
so I set collect input component like below.

I found a very interesting thing which I would like to consider it as bug.
if I press 1234567890, I found that I can collect the input by set participate function both in success path and fail path which really confused me.
I set in participate data in success path with successAccount parameter, in fail path with successAccount parameter.
and get both successAccount and successAccount in participate data , both value was 1234567.
is this a bug ?
and what's the best practice for this business request ?
#ArchitectureandDesign
------------------------------
Chengcheng Zhang
FIL Fund Services (Bermuda) Limited
------------------------------