cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1201
Views
0
Helpful
6
Replies

Modify called number

j.huizinga
Level 6
Level 6

Hi,

I have a UCCX 11.0 and in the script I have to change the called number to something else

For example I receive as called number 0XX and have to modify this to 1XX

I must use the SET step for this, but what string constructors and string methods I have to use to replace the 0 with a 1

 

Any help would be apreciated

 

Thanks

 

JH

6 Replies 6

TrickTrick
Level 3
Level 3
Do you mean the trigger ? As far as I know, the called number that triggers your script to work is configurable in the CCX server at the application level

Hi,

Thanks for the reply

I have found a simple way:

 

"1" + CalledNumber.substring(1)

 

This does the trick

 

Jan

Or you can use a number of other Java String Methods under your Set step in the editor, Like .replaceFirst(string,string):

2018-1001-replaceFirst-javaStringMethod.png2018-1001-replaceFirst.PNG

Also, your method is okay, so long as the Called Number is static.  You will replace any occurrence of the character in the provided string ("1" in your example) no matter where it appears in the string variable...   So if you are using dynamic variables, and the Called Number comes in as "3140" the method you show will convert to "3040".

 

....just an idea to consider.

 

-Sean

Come to think of if, so will mine...   Ha ha ha...  :-)

2018-1001-replaceFirstRevB.PNG

...this will match only the beginning part of the string with the required value, and replace it with the desired replacement string.

All string variables.