Getting a list of countries and dial codes automatically

I am designing a questionnaire in xlsform, one question will be asking the country of origin and after selecting the country, the next question will be the phone number including country dialing code. My questions are: 1. Is there a way to display all countries in the world without having to list them in the choice sheet as we do with dates, time etc? 2. After selecting the country, is it possible for the next question on phone number to already prefill the dialing code based on the selected country so that the respondent just fills in their phone number?

You may find that a select widget with autocomplete lets the user search and find the country more quickly/easily than scrolling a list.

You could add the dialing code data to your survey by preloading it in a CSV. Then use the response about country and a calculate field to pull the correct dialing code. You could then display the dialing code in a note or a question label on the same page as a question asking for the rest of the phone number.

For the phone number you'll want to use a number text widget (type=text with appearance=numbers) as the integer widget has a limit of nine digits.

Are you sure that the user's phone number country will always match their country of origin?