Forum Academy Marketplace Showcase Pricing Features

How to save phone numbers in DB?

Saving a Users phone number is not working because the default phone number option is for US phone numbers, but I am in the UK. A standard UK number looks like this:

+44 01323 123456 (landline)
+44 0777 123456 (mobile)

I have tried saving as text, but I get an error:

This thread suggests saving phone numbers (as text) and prepending them with a [+][countrycode][phonenumber] . How do I add a [+], I mean where do I add that?

1 Like

What ‘type’ is your phone number field in the db? And what ‘type’ is the input set to? In any case there’s obviously a mismatch there.

As you say, phone numbers should be saved as a text (they are not numbers).

If you want to add “+” then you can just add that before the input’s value.

Although there are a couple of plugins for formatting and displaying phone numbers that are worth looking at (one by Zeroqode and one by BDK).

There is no input value field?

No, I mean you save it in the workflow when you write to the database.

Or are you not worried about saving the + to the database and only want to display it in the input?

I’ve tried to add a ‘+’ sign (see arrow below) but it won’t accept it?

As long as your phone number field is s text (which it should be) then it should work.

(make sure you click in the dark grey box before the input’s value and not on it)

2 Likes

Ah got it, thank you. I think it was just fiddly to add the ‘+’ to the string but when I deleted and did it again it worked.

1 Like