cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1248
Views
10
Helpful
4
Replies

Need to trim leading digits for DB Lookup - UCCX 7

michael_cole
Level 1
Level 1

Currently have a UCCX script that will be performing a DB lookup based on ANI, however, I've noticed that when my ANI comes in it is prefaced with a "91".  Rather than try and reconfigure what the gateway is accepting, I am wondering if it is possible to strip those 2 digits with Java language before sending it into the DB Read step using a Set command...I'm not too familiar with Java coding...Is this possible?

Thanks

1 Accepted Solution

Accepted Solutions

Aaron Harrison
VIP Alumni
VIP Alumni

Hi

You can insert some Java for this... try something like this in a 'do' step (yourvariable swapped for your string var name containing ANI):

{

     if (yourvariable.startsWith("91"){

          return = yourvariable.substring(2,yourvariable.length());

     }

}

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

View solution in original post

4 Replies 4

Aaron Harrison
VIP Alumni
VIP Alumni

Hi

You can insert some Java for this... try something like this in a 'do' step (yourvariable swapped for your string var name containing ANI):

{

     if (yourvariable.startsWith("91"){

          return = yourvariable.substring(2,yourvariable.length());

     }

}

Aaron

Aaron Please remember to rate helpful posts to identify useful responses, and mark 'Answered' if appropriate!

brian1mcc
Level 4
Level 4

put your ani in a variable called AniStr and use the following in your set step

AniStr.substring(2)

Brian

edit - or what Aaron says

michael_cole
Level 1
Level 1

Thanks to both of you...will use Brian's in the event all numbers come in with "91" prepended and jump to Aaron's if they do not

Vinod Patil
Level 1
Level 1
Hi Michael, I have task to write a script for DB lookup based on ANI, no idea how to start the script if you have similar script could you please help me? Thanks and best regards, Vinod