The phone field allows to select a default option for the country. Is there a way to detect dynamically which country the user is in, using a service like ipinfo.io, and update the select country, for the user not to have to select it before entering the local part of the phone number?
I found a way to do it using Javascript (TF Business plan or above only). See below some code ideas. Yet, I think it might be an interesting idea to be able to pass a default_country_code hidden field, so that we can dynamically populate that field using the embed API, and the form automatically update the flags when loading, if detected.
If the field is a phone number
window.rendererData.form.fields[5].properties.default_country_code='ES'
If the field is a phone number inside a Contact Card
window.rendererData.form.fields[4].properties.fields[2].properties.default_country_code = 'FR'
Note, you need to modify the number inside the brackets [] to match the position of the field in your form. Or you can loop through all the fields to detect the type "phone_number"
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.