Condition: trigger an action if the prepopulated value is changed.

  • NGHS
    Asked on June 14, 2017 at 11:05 AM

    Hello! I have a request for a new condition.

    Let's say I prepopulate a dropdown field via URL:

           color=red

    This makes the dropdown field with ID "color" have value "red".

    Let's say I would like to have a condition for that dropdown. If I change the color to "blue", it does not match the initial value "red", I'd like to trigger an action.

    Ideally, I'd like to make another field equal something if the dropdown field does not equal the initial value.

    In short, it is: "If not equal to initial value"

     

    Does any of that make sense?

  • David JotForm Support Manager
    Replied on June 14, 2017 at 12:15 PM

    What is the form you are working on? I believe the red value is already part of the options listed in the Dropdown. If you want to trigger an action if the pre-populated value is changed, you can do it like this: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    Condition: trigger an action if the prepopulated value is changed Screenshot 30

    Example:

    Condition: trigger an action if the prepopulated value is changed Screenshot 41

    Let us know if you need more help.

  • NGHS
    Replied on June 14, 2017 at 12:19 PM

    BDavid, thanks for taking the time to respond. It looks like you are getting close to what I'm talking about. The difference here is that you had to manually designate the value "Red" in the conditional logic.

    My form fields are being prepopulated via links built dynamically from a webpage, driven by a database. So I am not able to manually designate a value in a condition. The condition would have to already know the initial value of the field. Does that make sense?

  • David JotForm Support Manager
    Replied on June 14, 2017 at 12:33 PM

    That's odd, as far as I have tried, it is not possible to populate a value that is not listed in a dropdown:

    Condition: trigger an action if the prepopulated value is changed Screenshot 40

    What is the form you are working on? Also, what is the field in question? If the field in question is a textbox, you could use "Does not Contain" state, instead of "is equal to":

    Condition: trigger an action if the prepopulated value is changed Screenshot 51

    Result: https://form.jotform.co/71196604788872?color=Red  

    Condition: trigger an action if the prepopulated value is changed Screenshot 62

  • NGHS
    Replied on June 14, 2017 at 12:35 PM

    Instead of a dropdown, I'm using a basic input field. I was trying to think of an example but didn't realize my example wasn't possible. Swap the dropdown with editing the value in a short text field.

     

    PS. You can prepopulate a dropdown using a URL parameter, but the option must already exist in the dropdown.

  • David JotForm Support Manager
    Replied on June 14, 2017 at 12:58 PM

    If you you are using the input field, you can do it as shown on my previous example. Let us know if you need more help, or open a new thread if you need anything else.