Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to remove empty space from phone number using script.

Sriharsha3
Tera Contributor

How to achieve this using a transform script before loading of data or a business rule after load/.

Suppose my phone number looks this way from data : +91 9xxxxxxxxx , i need it to transform to +919xxxxxxxxx so there is no inbetween spaces.

 

Thanks

1 ACCEPTED SOLUTION

You can write this in your before script

var number = source.u_number; //Replace u_number with the actual import set column name for phone number

number= number.replace(" ", "");
target.mobile_phone = number;

 

View solution in original post

10 REPLIES 10

Alikutty A
Tera Sage

Hi,

You can try this out

var number = '+91 9xxxxxxxxx';
number = number.replace(" ", "");
gs.info(number); 

Hello Ali,

 

How can i give this in transform script for mobile_phone field so that it imports without space.

Thanks

You can write this in your before script

var number = source.u_number; //Replace u_number with the actual import set column name for phone number

number= number.replace(" ", "");
target.mobile_phone = number;

 

Hello Ali I'm getting true in Mobile phone field after transform instead of the number