cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
499
Views
0
Helpful
2
Replies

Call Studio Script - Length Function

TulioDiniz
Beginner
Beginner

Hi guys, can you help me with something?

 

I'm building a CVP script using Call Studio application. Using the Digits Element, the application collects 11 to 14 digits entered by the user. After that, I need to identify the number of entered digits (length). Does anyone knows how to do it?

 

Thanks in advance. 

2 Replies 2

david.macias
VIP Advocate VIP Advocate
VIP Advocate

There are two ways.

 

1. Use the decision element and check that the value is greater than 9999999999 and less than 1000000000000000. I didn't count all the zeros and nines, but hopefully you get what I mean.

2. Use an action element and in the settings use JS, here's an example for something unrelated but pretty close.

var ani = {CallData.ANI};
var npanxx = "";
if(ani.length >10){
npanxx = ani.substring(1,7);
}else if(ani.length<11){
npanxx = ani.substring(0,6);
}else{
npanxx = "000000";
}
npanxx

 

david

 

Thank you for your response. 

 

The first solution won't work for me. It is possible that the user inputs some Zeros on the left and those digits still have to be considered. For example, 00060305000104 is still a 14-digits valid string for me. 

 

I'll give a try on the second solution and i'll let you know. 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Recognize Your Peers