cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3534
Views
16
Helpful
18
Replies

Get Digit String

TomMar1
Level 3
Level 3

Novice script-er here...

 

I am updating an existing script to include a get digit string portion to allow callers to enter their customer number.  This will be displayed in Finesse when the call is routed to an agent.  All that is OK..

However in testing I notice if the caller enters only the # key, which is the terminating digit, they get the canned "I'm sorry..." something went wrong call us later automated prompt.

 

If the get digit string times out or is unsuccessful it is fine and the script proceeds, if they enter between 1 and 8 digits followed by ## all is well.  But entering just the# key results in a failed call.

 

I tried an If statement to check for # and follow the same path as a timeout or unsuccessful but that does not appear to be working as I have it configured

 

Does anyone have a solution they can offer?

 

UID.PNG

 

Thanks in advance

3 Accepted Solutions

Accepted Solutions

It sounds like you may be receiving a work flow exception error?  Please post the exact error, if you can. 

I suspect it may be because in a subsequent next step the application is trying to evaluate or process a string variable that could possibly be 'null'.  When the caller is just pressing the '#' key, no digits are entered into the variable created to accept a string value.  It may be collecting 'null' or Empty ("").

You could add some nested logic after the Get Digits step and do a reactive debug to test whether or not when the caller is "just pressing #" what the value of your digit variable 'UID' is being assigned.  If it is 'null' you will need to create some reactive logic to avoid this--like send the caller back to the Get Digits step.

Sample idea:

2019-0927-stringTerminatingDigit.png

 

Best wishes,

Sean

 

View solution in original post

Anthony Holloway
Cisco Employee
Cisco Employee

I would recommend you do some input validation right after the Successful branch, and also point your Timeout branch to your Successful branch.

 

E.g.,

Get Input:
UID = Get Digit String()
  Successful
    Input Validation:
If (UID == null || UID.trim().length() != 8)
True
Goto Handler Failure
False
Play Prompt (You entered + UID) Timeout Goto Input Validation Unsuccessful Handle Failure: Play Prompt (You didn't do it right, try again) Goto Get Input

 

You could even abstract the outcomes into their own sections and just use a Goto in each branch.

 

E.g.,

Get Input:
UID = Get Digit String()
  Successful
    Goto Input Validation
  Timeout
    Goto Input Validation
  Unsuccessful
    Goto Handle Failure

Handle Failure:
Play Prompt (You didn't do it right, try again)
Goto Get Input

Input Validation:
If (UID != null && UID.trim().length() == 8)
  True
    Goto Process Input
  False
Goto Handle Failure Process Input: Play Prompt (You entered + UID)

 

Just some different ideas.

 

Also, just a note, the real problem you were facing was two-fold:

 

1) The # will not be in the UID string, because it's not valid input.  The * and # by default affect the behavior of the step, and are not recorded in the String variable.  Hence, your If step to check for the # didn't work.  Checking for an empty string is what you needed.

 

2) And you needed to move that If step above the Create Generated Prompt step, so that you didn't attempt to playback when the value was invalid.

 

I hope that helps.

View solution in original post

Hi,
It is very simple.

If your current variable that is getting the input is Integer type (for example, i_UID) so just create another variable with a type of String (for example: s_UID).

And after customer's input just use the "Set" node and set the following:

s_UID = "U" + i_UID

 

It should do the trick i think.

View solution in original post

18 Replies 18

Slavik Bialik
Level 7
Level 7

Hi :)

What is the maximum number of digits expected? 8 digits?

If that's the case, try changing the maximum input digits to 9 and test again.

Because when you enter 8 digits it is continuing the script, but when the maximum is 8 and 8 digits entered it won't wait to the #.

So when you are actually pressing the #, it is affecting the next action in the script (like play prompt or some menu or whatever) so when the next action gets the # it might give you the "I'm sorry" prompt.

Thanks for the suggestion.  I changed the input length to 9 (as the max digit length to be entered is 8) but the result of pressing just the # key is the same.

Any suggestions for specifically watching for the # key only and moving the call to a label marker in the script? 

It sounds like you may be receiving a work flow exception error?  Please post the exact error, if you can. 

I suspect it may be because in a subsequent next step the application is trying to evaluate or process a string variable that could possibly be 'null'.  When the caller is just pressing the '#' key, no digits are entered into the variable created to accept a string value.  It may be collecting 'null' or Empty ("").

You could add some nested logic after the Get Digits step and do a reactive debug to test whether or not when the caller is "just pressing #" what the value of your digit variable 'UID' is being assigned.  If it is 'null' you will need to create some reactive logic to avoid this--like send the caller back to the Get Digits step.

Sample idea:

2019-0927-stringTerminatingDigit.png

 

Best wishes,

Sean

 

Anthony Holloway
Cisco Employee
Cisco Employee

I would recommend you do some input validation right after the Successful branch, and also point your Timeout branch to your Successful branch.

 

E.g.,

Get Input:
UID = Get Digit String()
  Successful
    Input Validation:
If (UID == null || UID.trim().length() != 8)
True
Goto Handler Failure
False
Play Prompt (You entered + UID) Timeout Goto Input Validation Unsuccessful Handle Failure: Play Prompt (You didn't do it right, try again) Goto Get Input

 

You could even abstract the outcomes into their own sections and just use a Goto in each branch.

 

E.g.,

Get Input:
UID = Get Digit String()
  Successful
    Goto Input Validation
  Timeout
    Goto Input Validation
  Unsuccessful
    Goto Handle Failure

Handle Failure:
Play Prompt (You didn't do it right, try again)
Goto Get Input

Input Validation:
If (UID != null && UID.trim().length() == 8)
  True
    Goto Process Input
  False
Goto Handle Failure Process Input: Play Prompt (You entered + UID)

 

Just some different ideas.

 

Also, just a note, the real problem you were facing was two-fold:

 

1) The # will not be in the UID string, because it's not valid input.  The * and # by default affect the behavior of the step, and are not recorded in the String variable.  Hence, your If step to check for the # didn't work.  Checking for an empty string is what you needed.

 

2) And you needed to move that If step above the Create Generated Prompt step, so that you didn't attempt to playback when the value was invalid.

 

I hope that helps.

Thanks for the help and suggestions.  Looks like the value of # alone is not null but rather empty ""

I used the following logic to resolve the issue.

zCapture.PNG

Thank you Sean and Anthony for your responses.

Right now I am just trying to find my way through the configuration.  I hope to come back at some point and improve the logic for the scripts I am working on.

That's cool. Good luck with it!

...and I'm back

Trying to figure out how to add a static character to the front of the caller entered UID

All callers ID numbers begin with a "U", so I would like to somehow add the U to the front of the digit string they enter so it is presented in Finesse.  If nothing is entered only a U would be displayed.

Seems simple enough, but I am stuck on the logic.

Any more direction would be greatly appreciated.

Thanks

Hi,
It is very simple.

If your current variable that is getting the input is Integer type (for example, i_UID) so just create another variable with a type of String (for example: s_UID).

And after customer's input just use the "Set" node and set the following:

s_UID = "U" + i_UID

 

It should do the trick i think.

Thank you Slavik.  Being still new at this it took a few tries to get the set step correct.  I'll fill in some blanks for other newbies to reference in the future.

2 variable were needed:  I used UID and uUID, both were type string and value set to ""

xCapture.PNG

So when the caller enters digits it is saved as the UID variable

Next the variable uUID is used which combines the value U with the collected digits

Looks like this in the script

yCapture.PNG

Once again thank you everyone for the assistance

@TomMar1 

Get digits I added main prompt "Please enter the employee ID" and employee ID  input length is "10".  and I done script debug if users enters the 9 digits nothing showing from the variables ,If I enters the 10 digits I am getting the digits properly. So I need to play the prompt the prompt  if there is no digits collected. can you tell me how to acheive this.

 

You get digits step can enforce the legth for you also, but if you want to do it outside of that you can use an IF node with something like "myVarDigitHolder.length() > 9".

david

I think that something needs to be done in the 'Timeout' branch. If the caller enters less than the input length, that will generate a timeout condition. You can test that by entering 9 digits and then a '#' to terminate the input without getting the full digit length. I don't have a script in front of me for this, but I seem to recall that a break or goto was needed in the Timeout branch to accept less than the full digit string if the caller did not press a '#' at the end.

@Elliot Dierksen 

Apologize for the delayed response. I was on leave.

I created the same it worked but loop not stopping. If I want to end the call after 3 tries . What I need to be done.

 

 

 

 

 

 

 

 

 

Are you saying there is a loop around the 'Get Digit String' step? If so, you need to break out of the loop in the Timeout branch. You can add a label just after the loop and Goto that label after you have done validation (if applicable) in the Timeout branch.