How to populate another field with just the Country from address field

  • mgcaledonian13
    Asked on July 2, 2016 at 3:36 AM

    How can I Populate anther field with just the Country from address field

    Willy Scott

  • Boris
    Replied on July 2, 2016 at 11:49 AM

    Fields can normally be populated from one field to another by using our insert/calculate conditions, however that will forward the value of the entire address - not just the country field.

    So normally, this will forward the street, state, ZIP code, etc.

    To work around this issue, we can use another address field to collect the Country. We can disable all other elements of the second Address field, except the Country element, and forward the value from the first address field to this second address field.

    Please take a look at the following demo form:

    https://form.jotformpro.com/form/61834813899976

    (Note that the Country will get forwarded the very moment your users start typing their address into any elements of their address.)

    To disable all the other elements of the second Address field, please simply click on its Fields button at the top, and un-check all the elements that are not Country:

    How to populate another field with just the Country from address field Image 1 Screenshot 30

    Then, please set up an insert/calculate condition, and use its "Calculate a field's value" option:

    How to populate another field with just the Country from address field Image 2 Screenshot 41

    When you add the the field to the condition (step 2 on the above image), if it shows as 0-9 next to the field, please click on it so it changes to showing A-Z (step 3 on the above image).

    Please try it out and let us know how it goes. You can also clone the above linked form into your own account for closer examination by following this guide:

    https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL

  • mgcaledonian13
    Replied on July 3, 2016 at 2:32 AM

    That does not seem to give me the right effect.

    I want just add the Country element to a text field so that I can have a different order of fields in a Grid report and only the country showing not the full address.

    Sadly I cannot have a separate country drop down field with the Country element removed from Address field, I missed the need for it when building the form so I have to keep the Country element in the address field. The Form has data in the country field already and I will manually add the Country to the new field in the Submissions editor later.

    So how do I get only the Country into the new field when further data is added?

    Link to form https://form.jotform.com/61833648535968

    How to populate another field with just the Country from address field Image 1 Screenshot 30

     

    How to populate another field with just the Country from address field Image 2 Screenshot 41

     

  • jonathan
    Replied on July 3, 2016 at 2:49 AM

    Hi,

    I am on this. Please allow me some more time to find a soluiton that can work while still retaining the full address field (with Country) of your form and use it to populate another field in the form.

    I'll get back to you once I have update.

    Thanks.

  • mgcaledonian13
    Replied on July 3, 2016 at 3:00 AM

    It appears that the images are not showing in the original post

    Here they are again

    How to populate another field with just the Country from address field Image 1 Screenshot 30

    How to populate another field with just the Country from address field Image 2 Screenshot 41

  • jonathan
    Replied on July 3, 2016 at 3:23 AM

    Thank you for providing the screenshot images.

    Unfortunately, I could not find a working solution that can split the full address field so that the Country field/data can be separately used.

    Using a separate field (dropdown) as suggested already, seems to be the only way to achieve the separate data.

    May I ask what is the grid report you were trying to use? I am looking for workaround on the report instead. If you will use spreadsheet or Excel report, there is a way to split the address field into mulitple element so that you can capture the Country element only. 

    This is by using the text-to-column built-in function of spreadsheet.

    We will wait for your updated response.

  • jonathan
    Replied on July 3, 2016 at 3:37 AM

    Actually the Excel Report have the full address field split already.

    Example:

     How to populate another field with just the Country from address field Image 1 Screenshot 20

    You may want to try this feature instead for your grid so that you can use the Country data separately.

    Cheers

     

  • mgcaledonian13
    Replied on July 3, 2016 at 5:39 AM

    As I am able have a  repeat of the Name fields can I not just repeat the address field and by adding CSS disable the Add 1,Add 2, Toewn City etc leaving just the Country which I then use in the report?

    The report at present shows the full address.

    Report Link  

  • mgcaledonian13
    Replied on July 3, 2016 at 6:05 AM

    Oops! thought I had not posted this as I had left the editor open.

     

    As I am able have a  repeat of the Name fields can I not just repeat the address field and by adding CSS disable the Add 1,Add 2, Toewn City etc leaving just the Country which I then use in the report?

    The report at present shows the full address.

    Report Link  

  • Nik_C
    Replied on July 3, 2016 at 9:17 AM

    I am not sure I understood your question. If you use CSS to hide the fields it will not prevent creating of fields in the report. If the fields are hidden the report will have columns for those fields but it won't have any value for that column since the user can't enter any value.

    You can try using the Country widget if you only need to collect the country. 

    Let us know if this worked for you.