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

  • Profile Image
    mgcaledonian13
    Asked on July 02, 2016 at 03:36 AM

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

    Willy Scott

  • Profile Image
    Boris
    Answered on July 02, 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:

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

    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

  • Profile Image
    mgcaledonian13
    Answered on July 03, 2016 at 02: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

     

     

  • Profile Image
    jonathan
    Answered on July 03, 2016 at 02: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.

  • Profile Image
    mgcaledonian13
    Answered on July 03, 2016 at 03:00 AM

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

    Here they are again

  • Profile Image
    jonathan
    Answered on July 03, 2016 at 03: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.

  • Profile Image
    jonathan
    Answered on July 03, 2016 at 03:37 AM

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

    Example:

     

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

    Cheers

     

  • Profile Image
    mgcaledonian13
    Answered on July 03, 2016 at 05: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  

  • Profile Image
    mgcaledonian13
    Answered on July 03, 2016 at 06: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  

  • Profile Image
    Nik_C
    Answered on July 03, 2016 at 09: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.