09-19-2017 12:59 PM - edited 03-14-2019 05:35 PM
Not a scripting expert but i know there are many on here who are so here goes:
We have a script that requests the caller input a few numeric values that are then stored as string variables, the number of characters in field 1 can be from 6 to 12 long, in Field 2 can be from 8 to 10 long, and field 3 (callers SSN) is or should always be 9 digits long.
So caller is prompted to enter a number relating to a form they received at a lab (Field 1) followed by #. The input length is 12 and the terminating digit is #. I thought that by having the system read back the digits entered to the caller and asking them to validate would suffice, but what is happening is that the callers are simply pressing # without entering any digits, then when they are prompted to validate they press # again saying that the blank prompt is correct; and the system is accepting this and writing a blank to the variable, which writes a blank to that field in the DB.
Long story short, i need an expression for the get digit string to enforce a minimum character input in order for the step to be successful and the system prompt to be generated.
Any direction appreciated. A snap of the step im trying to modify is attached.
Solved! Go to Solution.
09-19-2017 02:16 PM
You have couple of choices, first on the get digit string you can specify minimum expected digits and if less digits are entered the system will not follow the success branch, or after you collect digits under the success branch add if statement such as "if len(entered_digits_var) < 6" that is followed by goto step to prompt again.
09-19-2017 02:47 PM
Yeah, I got confused, there is no minimum length on the step, the syntax for checking length of the string would be "strDigits.length() > 6" where strDigits is the variable name.
09-19-2017 02:16 PM
You have couple of choices, first on the get digit string you can specify minimum expected digits and if less digits are entered the system will not follow the success branch, or after you collect digits under the success branch add if statement such as "if len(entered_digits_var) < 6" that is followed by goto step to prompt again.
09-19-2017 02:25 PM
I was hoping there was an easy way to do this via the input field, i believe that is what your first option is referring to. But im not sure of the way to specify the minimum digits entered under that step, just the maximum under the Filter tab. Can you help me with the correct verbage for that step?
Your second option, adding the IF step to the success leg, i tried that but could not get the proper verbage so it never took. I will try with your recommendation. Thx
09-19-2017 02:47 PM
Yeah, I got confused, there is no minimum length on the step, the syntax for checking length of the string would be "strDigits.length() > 6" where strDigits is the variable name.
09-20-2017 06:36 AM
Genius, implemented and tested using the IF string and your syntax and everything working great.
5 stars. Thanks for the help.
Cheers
06-12-2018 03:51 AM
Please Can you help me with that case ?
I want to make accountno length variable for example from 4 to 8 digits
and I can't do it @Chris Deren
Please check attached
06-13-2018 05:49 AM
Then you need to set your input length as 8, and add logic under timeout branch to check if 4 digits were entered instead.
06-13-2018 05:53 AM
Sorry I don't understand what logic and how can I add it as I am a beginner in ccx scripting @Chris Deren
06-13-2018 06:02 AM
I want it to match variable digit length not exactly specific length
06-13-2018 06:11 AM
Chris is spot on. I have attached a very simple script where the get digit string is set to 8 characters, and then logic checks to ensure at least 4 digits were entered. If not it will loop them back to enter the acct no again. Im sure there are other ways to do it but this way is pretty simple. I cant open your picture so im not sure if that was exactly what you were looking to do. The only thing you would have to do is change the input length on the get digit string to 9 if you wanted the user to press # after entering 8 digits, or leave it at 8 and if the acct no is less than 8 they can press # to finish without waiting the timeout, if they enter 8 digits then press # will not hurt unless you have a follow up step to validate by pressing # (I got caught on that one on my finished script, ooops)
06-14-2018 12:50 AM
Hi @hallinanpv1 I tried what you said but in another way but the problem still exists and matches only 8 digits not 5 or 6 or 7 just 8 digit length
Simply the number which I enter the input length is the only length matched when I enter account no
I want variable input length
Please check my script attached
06-14-2018 05:23 AM
Post your script. Are you waiting through the inter-digit timeout after entering less than 8 digits or pressing # at the end?
06-19-2018 12:44 AM
Thanks all, Now it works fine when I set terminating digit # and I now can enter up to 8 digit length
I can't upload my script
06-14-2018 05:44 AM
Ahmed; I am unable to open your attachments so im not understanding why you are still having to enter 8 digits. In the Properties of the get digit string, the input length set to 8 digits only means that is the maximum number of digits that can be entered. you could enter a single digit if you wanted to and it would take. Then you use the IF statement to ensure that at least 4 digits were entered. Unless im not understanding what you are attempting to do this way should work.
08-01-2018 10:49 PM
Hi Chris
i need need to do something similar in a ucce system but the digit check doesn’t seem to work
if len(call.caller entered digit<4)
i tried it with “” around the 4 but it failed, do
I need to put the ced into a PV then do a len check?
i confirmed the ced has the correct number of digits by displaying ced in a PV and displaying it in Finesse so that is all good
thanks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide