how to prefix country code to phone no

how to prefix country code to phone no

  

hi,      

           when user enter phone no  in a textbox and select country code the country code should be prefixed to phone no.how we can concatenate


Inline image 1

Hi Karthik, the image you added is not showing. Can you please update your post with a working image?

Remco Dekkinga wrote:

Hi Karthik, the image you added is not showing. Can you please update your post with a working image?



Hi Karthik,

First of all, use a field for the phone number in the database without prefix and a field for the country prefix. It's easier to work with.

The fields can be concatenated by doing the following: 

FullPhoneNumber = CountryCode + PhoneNumber

Kind regards,

Remco Dekkinga

Remco Dekkinga wrote:

Hi Karthik,

First of all, use a field for the phone number in the database without prefix and a field for the country prefix. It's easier to work with.

The fields can be concatenated by doing the following: 

FullPhoneNumber = CountryCode + PhoneNumber

Kind regards,

Remco Dekkinga


hi remco,

               Thank you for your reply .In a text box how we can concatenate by adding expression and also i want user to enter the phone no and after selecting code ,code should be prefixed.it should happen in same input box



Be aware that if you use the same variable for the phonenumber and the full phonenumber, that on every OnChange of the country the new country code is added in front of the phonenumber, you will end up with something like: +315+350123456789 which is a result that you don't want.

The textbox for the full phonenumber should have a variable behind it.

In the combobox (country-selector) you create an OnChange action that will trigger a new action.

Inside this action you concatenate the country code with the phonenumber and assign it to the variable that you use for the full phonenumber. After concatenation, do an ajax refresh on the full phonenumber.

As far as UX, try to create a screen where the user can enter the fields separately (CountryCode and PhoneNumber) and on all screens where you show or use the number use the concatenated full phonenumber.

This way it's simple for the end user to edit his phonenumber and for the other system users to use the number.

Kind regards,

Remco Dekkinga


Remco Dekkinga wrote:

Be aware that if you use the same variable for the phonenumber and the full phonenumber, that on every OnChange of the country the new country code is added in front of the phonenumber, you will end up with something like: +315+350123456789 which is a result that you don't want.

The textbox for the full phonenumber should have a variable behind it.

In the combobox (country-selector) you create an OnChange action that will trigger a new action.

Inside this action you concatenate the country code with the phonenumber and assign it to the variable that you use for the full phonenumber. After concatenation, do an ajax refresh on the full phonenumber.

As far as UX, try to create a screen where the user can enter the fields separately (CountryCode and PhoneNumber) and on all screens where you show or use the number use the concatenated full phonenumber.

This way it's simple for the end user to edit his phonenumber and for the other system users to use the number.

Kind regards,

Remco Dekkinga



how to concatenate in action whether we can add expression in the flow




Hi Karthik,

Use an assign (=) in your flow.

Variable: FullPhoneNumber

Value: CountryCode + PhoneNumber

And add an ajax refresh for the FullPhoneNumber textbox.

Kind regards,

Remco Dekkinga


Remco Dekkinga wrote:

Hi Karthik,

Use an assign (=) in your flow.

Variable: FullPhoneNumber

Value: CountryCode + PhoneNumber

And add an ajax refresh for the FullPhoneNumber textbox.

Kind regards,

Remco Dekkinga


yes i added assign operator but after entering phone no and when i select country code from combo box the phone number disappears in text box and only country code is visible



Hi Karthik,

Then you are using the wrong variable for the phonenumber in the assign.

Can you share your eSpace (.oml)?

Kind regards,

Remco Dekkinga