Answered

Country Code + Country Field


Userlevel 2
Badge +1

Hi there,

 

I am curious if you can somehow extract the country from the phone field.

In my typeform, it is vital I get both Country and Phone number (since I use country to filter later),

but it seems that they are providing the country twice (once in phone field and once in country)

 

Since 99% would have a phone number from their own country, could it done so that the phone field can acutally give a country variable, so I will not have to ask for this twice? 🤔

icon

Best answer by john.desborough 5 August 2021, 17:14

View original

12 replies

Userlevel 7
Badge +5

Hey @Søren Kjelstrup! Happy you're here! :sunglasses:

It's not possible to extract the country from the phone field at the moment, but I totally understand how this would be useful. You could remove the Country question and get this information from the phone number question, but you would need to do it manually.

Then, if you want to make sure you don't miss the 1% located in a different country, you could add a not required question saying something like: "If your phone number is not from the same country you're based, can you tell us in which country you are located?".

Let me know if this works for you! I'm very curious to know if it does! :pray_tone2:

Userlevel 1

It will be extremely useful to have a pre-defined country list, so clients can choose the country. You have already countries in the Phone Number list (so why not adding it to a separate list?)

What's also important is when a client chooses the country and in the next question we ask about the phone number, the system will know which country code to pre-define.

Userlevel 7
Badge +6

@AntonC - this from another user

if you have country already selected, you could create text variable and then populate it with the country code based on a logic rule (or rather a set of logic rules - one for each country in your list) and then you can capture the phone number ie 

  • if i choose UK from the list: if Qn answer is UK, then replace v_countrycode with ‘+44’  
  • then you can have them enter in the phone number - which is a text string. 
  • if you export/connect these to a google sheet, for example, you can concatenate the two fields together to give you the entire phone number as a single string

it will be a little work to set up the logic rules for the country list but once done, it should be easy to implement

 

des

Userlevel 1

Hi @john.desborough , thank you!

I was spending the last hour understanding your instructions :face_palm_tone1:. Many new things were discovered, but still, it’s not working. Could you please tell me what is wrong with these screenshots? Thanks!

 

 

Userlevel 2
Badge +1

@AntonC - this from another user

if you have country already selected, you could create text variable and then populate it with the country code based on a logic rule (or rather a set of logic rules - one for each country in your list) and then you can capture the phone number ie 

  • if i choose UK from the list: if Qn answer is UK, then replace v_countrycode with ‘+44’  
  • then you can have them enter in the phone number - which is a text string. 
  • if you export/connect these to a google sheet, for example, you can concatenate the two fields together to give you the entire phone number as a single string

it will be a little work to set up the logic rules for the country list but once done, it should be easy to implement

 

des

This makes sense, but it you are creating a global form, it’s a lot of work 😆

But thanks for the solution, I will do this for my top 10 countries. 

 

It would, never the less, make much sense to make a predefined country list, with a country dropdown. 

Userlevel 7
Badge +6

@AntonC - change the name of variable_0 to the v_countrycode.. the second screenshot is correct (with the change just recommended,,,

 

 

des

Userlevel 7
Badge +6

@AntonC - this from another user

if you have country already selected, you could create text variable and then populate it with the country code based on a logic rule (or rather a set of logic rules - one for each country in your list) and then you can capture the phone number ie 

  • if i choose UK from the list: if Qn answer is UK, then replace v_countrycode with ‘+44’  
  • then you can have them enter in the phone number - which is a text string. 
  • if you export/connect these to a google sheet, for example, you can concatenate the two fields together to give you the entire phone number as a single string

it will be a little work to set up the logic rules for the country list but once done, it should be easy to implement

 

des

This makes sense, but it you are creating a global form, it’s a lot of work 😆

But thanks for the solution, I will do this for my top 10 countries. 

 

It would, never the less, make much sense to make a predefined country list, with a country dropdown. 

@Søren Kjelstrup - as much as it makes sense, it will likely be a while before this comes out of the product development team. 

as a workaround, for my forms, I took the time to create a form that had a drop down list of 100 countries (the ones in which it is most likely for my business to ever possible work) and created the logic rules to assign the country code a variable based on the user’s choice. The second question in this form asks for the phone number, without the country code. 

If i need to create a form that asks for this information, what i now do is to duplicate this two question form and add other questions to it, so that i can build out the full and complete form without having to remake or redo the ‘full list’ again. If i need to trim the list down to a subset, it is much easier to remove the country entries from the list and the associated logic rules. 

it is not a perfect solution but it speeds up the process for me immensely. 

just my tuppence from the igloo

 

des

Userlevel 1

Thanks @john.desborough 

I’m still doing smth wrong :worried: Could you please check where is the mistake?

It’s still shows the US country code here :grimacing:

Userlevel 7
Badge +6

@AntonC - it won’t change the icon in the phone number field with the approach that i mentioned. 

I should clarify my response above: in asking for a phone number, i use a short text field instead of the phone number question to collect the actual phone numbers .. this way i have the ability to concatenate the fields in a Google Sheet .. 

des

Userlevel 1

@john.desborough 

Thanks anyway! :thumbsup::thumbsup::thumbsup: now I know how variables work :grinning:

Userlevel 7
Badge +5

Wow… I'm mesmerized by @john.desborough's answer! Amazing! :clap_tone2:

Did you manage to get this done, @Søren Kjelstrup and @AntonC? We have a thread in our community where we're collecting product features requests.

Over there, you can write your suggestions so you'll have more visibility on them!

We're waiting for your suggestions! :wink:

Userlevel 5
Badge +5

It will be extremely useful to have a pre-defined country list, so clients can choose the country. You have already countries in the Phone Number list (so why not adding it to a separate list?)

What's also important is when a client chooses the country and in the next question we ask about the phone number, the system will know which country code to pre-define.

I would also be interested in this !

Reply