How do I setup conditional logic based on geolocation?

  • endrinita
    Asked on February 20, 2021 at 9:52 AM

    I have an address field that uses the geolocation widget. I would like to use the state to perform conditional logic (i.e. if the state is FL, show this dropdown menu).

    However, when I use the logic, IF ADDRESS CONTAINS "FL, USA", the condition is triggered even for other states (i.e. if the address is 34 Fletcher Court, Breckenridge, CO, USA, 80424). How do I ensure that it is only triggered if the address contains the exact match "FL, USA"?

  • Kat JotForm Support
    Replied on February 20, 2021 at 5:46 PM

    Hi there,

    Happy to help!

    I made a clone of your form 210433961572050. For the following conditions, what fields are you wanting to hide here?

    1613860722 60318f72c2118  Screenshot 10

    If you can elaborate a bit more on your process and what you're wanting to accomplish, I can certainly put together an example here.

    I noticed that, in the first condition, you've put "ends with": this will act as a "contains"-type condition, so if the "fl" characters are contained in the address field, this is where the issue will present itself.

    You could insert another condition with the "equal to" condition and select that if ANY of the rules are met, the condition is fulfilled.

    1613861064 603190c85f0c6  Screenshot 21

    We await your response.

  • endrinita
    Replied on February 23, 2021 at 8:02 AM

    Hello,  

    Thanks, If you look at my latest form, I tried setting up the conditional statement the way you described:

    1614085360 6034fcf071cf3  Screenshot 10

    However, the Test text does not appear for addresses in Florida.

    Any other thoughts?


  • Gaetan_B
    Replied on February 23, 2021 at 9:11 AM

    Hello,

    Thank you for the additional information.


    Could you change the condition from is equal to, to contains and let us know how it goes?


    Hope this helps.

    Do not hesitate to reach out if you need further assistance.

  • endrinita
    Replied on February 23, 2021 at 10:44 AM

    Ok, I tried this but still no luck getting the trigger to work. Any other suggestions?

    1614095038 603522bee7c02  Screenshot 10

    1614095012 603522a4e22ca  Screenshot 21

  • endrinita
    Replied on February 23, 2021 at 10:47 AM

    I still get the same issue that when I remove the wildcard character from the condition, it is triggered for addresses not in Florida.

    1614095162 6035233ad52a9  Screenshot 10

    1614095209 603523691ab8b  Screenshot 21

  • Kat JotForm Support
    Replied on February 23, 2021 at 1:26 PM

    Hi again,

    Thank you for clarifying with us a bit more!

    Please allow me a little more time to test, and I will update you via this thread as soon as possible.

    Thank you in advance for your patience and understanding as I investigate a solution for you!

  • Kat JotForm Support
    Replied on February 25, 2021 at 2:38 PM

    Hi again,

    Thank you for your patience as I worked towards a resolution with this.

    Currently, I am able to replicate the issue: this is due to the "FL" characters being detected within the entire address, the widget is likely unable to differentiate between the state and the characters within the address.

    To this end, I have opened up a ticket with our back-end team to look into to see if we can enable the geolocation widget to differentiate when these conditions are set.

    I sincerely appreciate your patience and understanding as we look into this!