Need to change the mobile number format

CRashmitha
New Contributor
New Contributor

hello Team,

We have requirement where the mobile number format should be changed whereas the country code should be as +1 by default for all the users and there should be no hyphens (-) in between the number as ( +1-123-123-1234).

We need to pass the phone number as +11231231234 to the users. +1 as country code and first three digits in the phone number as area code and rest 7 digits as mobile number.

Current logic we are using:

"httpParams": "{\"UserName\": \"${user.customproperty17!=null? user.customproperty17:user.employeeid}\",\"WorkEmail\": \"${user.customproperty16!=null? user.customproperty16:' '}\",\"WorkPhoneCountryCode\":\"${user.phonenumber!=null? user.phonenumber.split('-')[0].trim():''}\",\"WorkPhoneAreaCode\":\"${user.phonenumber!=null? user.phonenumber.split('-')[1].trim().substring(0,3):''}\",\"WorkPhoneNumber\":\"${user.phonenumber!=null? user.phonenumber.split('-')[1].trim().substring(3,6) +'-'+user.phonenumber.split('-')[1].trim().substring(6,user.phonenumber.split('-')[1].length()):' '}\",\"WorkPhoneLegislationCode\":\"${user.customproperty47!=null? user.customproperty47:''}\",\"WorkMobilePhoneCountryCode\":\"${user.customproperty5!=null? user.customproperty5.split('-')[0].trim():''}\",\"WorkMobilePhoneAreaCode\":\"${user.customproperty5!=null? user.customproperty5.split('-')[1].trim().substring(0,3):''}\",\"WorkMobilePhoneNumber\":\"${user.customproperty5!=null? user.customproperty5.split('-')[1].trim().substring(3,6) +'-'+user.customproperty5.split('-')[1].trim().substring(6,user.customproperty5.split('-')[1].length()):' '}\",\"WorkMobilePhoneLegislationCode\":\"${user.customproperty48!=null? user.customproperty48:''}\"}",

Thanks in Advance

 

1 REPLY 1

pruthvi_t
Saviynt Employee
Saviynt Employee

Hi @CRashmitha ,

Greetings.

As per your current login, what is the output you're getting. 

Also can you please elaborate further on where exactly you're using this logic.

Thanks,


Regards,
Pruthvi