What country name should I use for the conditional logic?

  • veriovka
    Asked on June 5, 2025 at 3:49 PM

    I'm trying to use the "Get Visitor Location" widget to geoblock our website to just the United States.

    I would create a condition where if the "Get Visitor Location" widget does NOT show the name of a specific country, I would turn on an error message and hide the other elements of my form.

    Problem is, I DON'T KNOW what our country is called in the widget!

    As in "it needs to match EXACTLY". The sample in the tutorial says "Canada". Canada has one name and works perfectly for this work around. My country is called The United States of America, or The United States, or United States, or America, or USA, or the US, or US. So I can't create an if/then condition if I don't know which exact words/letters they use to identify my country.

    I know this would be a problem for other countries too. China vs The People's Republic of China. The Netherlands vs Holland, France vs Faguo.

    Help! (thanks)

    our form - https://form.jotform.com/211538313447150

  • Podo: Support AI Agent
    Replied on June 5, 2025 at 3:49 PM

    Hi veriovka,

    Thanks for reaching out to Jotform Support. I'm an AI assistant. I'll do my best to help you until someone from the support team is available.

    Regarding the "Get Visitor Location" widget, the country name used in the widget for the United States is typically "United States". You should use this exact wording in your condition to match the visitor's location correctly. This is important because the condition requires an exact match to work properly.

    If you want to geoblock your form to only allow visitors from the United States, set your condition to check if the widget's country value is NOT equal to "United States" to trigger your error message and hide other form elements.

    This exact naming convention helps avoid confusion with variations like USA, America, or The United States of America.

    Give it a try and let us know how it goes.

  • veriovka
    Replied on June 5, 2025 at 3:51 PM

    Did not work. "United States" is the FIRST thing I tried

  • Podo: Support AI Agent
    Replied on June 5, 2025 at 3:51 PM

    Hi veriovka,

    If "United States" didn't work, please try checking the exact output from the widget by adding a temporary text field to your form that displays the widget's country value. This way, you can see the exact country name the widget returns and use that in your condition.

    Sometimes the widget might return abbreviations like "US" or other variations. Seeing the exact value will help you create the correct condition.

    Give this a try and adjust your condition accordingly.

  • Reymae JotForm Support
    Replied on June 5, 2025 at 4:29 PM

    Hi veriovka,

    Thanks for reaching out to Jotform Support. You can actually see the country your widget detected while you open the form.

    What country name should I use for the conditional logic? Image 1 Screenshot 70

    You can use it for the conditional logic you created. Also, note that you can create multiple condition, including your country name. Let me show you how:

    1. In Form Builder, in the orange navigation bar at the top of the page, click on Settings.

    2. Click on Conditions in the menu on the left side of the page.

    3. Hover your mouse on the condition and then click on the Pencil Icon.

    What country name should I use for the conditional logic? Image 2 Screenshot 81

    4. Enter the following values:

    What country name should I use for the conditional logic? Image 3 Screenshot 92

    What country name should I use for the conditional logic? Image 4 Screenshot 103

    5. Click on Save button once done.

    What country name should I use for the conditional logic? Image 5 Screenshot 114

    Also, since you're using Show condition, you'll need to hide the message field in the form so it will only show once the detected country by the location widget is not your country. Let me show you how:

    1. In Form Builder, scroll down, and select the Paragraph field.

    2. Under the Advanced tab, toggle On the Hide Field.

    What country name should I use for the conditional logic? Image 6 Screenshot 125

    Give it a try and reach out again if you have any other questions.

  • carlenelee78
    Replied on June 5, 2025 at 4:34 PM

    When using conditional logic in forms or software (like Google FormsTypeform, or website code), the country name you use must exactly match the values you’re comparing against Here's how to do it correctly:

    1. Use the Displayed NameIf the form has a dropdown list of countries, the name used in conditional logic should match the displayed label — e.g., use "United Kingdom", not "UK" or "GB", unless those are specifically what your form shows.
Your Reply