- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 01:22 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 01:53 AM
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 01:55 AM
write before transform script
and code like
var res=source.u_mobile_phone;
mob_phone=res.replace(" ","");
and then initialize it to target like
targate.mobile_no=mob_phone;
OR
Open your field map mob_no
there u ll get run script option
and write above script in script field.
//use proper syntax
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 01:39 AM
Hi,
use fieldname.trim(); it will remove spaces between it.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2019 02:18 AM
something like this should work:
var str = '+91 9xxxxxxxxx';
var str2 = str.replace(' ', '');
return str2;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 03:37 AM
Hi Param,
User below script to remove all space from phone number:
var number = '+91 9x xx xx xxxx';
number = number.replace(/ /g, '');
return number;
Thanks,
Harish

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2019 03:41 AM
hi
var number = '(123) 456-7891';
number = number.replace(/[^\d]/g, '');
gs.print(number);
or
var number = '+91 966 8890 789';
number = number.replace(/ /g, '');
gs.printnumber;
Thanks,
Rahul Kumar