Condition with multiple rules that uses "Empty" fails to stop if condition is already met

  • bdoodle
    Asked on October 12, 2015 at 11:52 AM

    Hello,

    On my PayPal order form, I want someone's email address to be the default value in their PayPal Account field, but allow them to override the value if needed.  I also want to have their email address in the PayPal Account field if they don't have a PayPal Account because they may still want to use PayPal for a credit card payment, and the interface to PayPal (I think) requires a value in this field.  To achieve this, I entered the condition below, but it's not working.  Please help.

    UPDATE A FORM FIELD VALUE
     
  • bdoodle
    Replied on October 12, 2015 at 12:48 PM

    Note that I'm unable to input anything into the PayPal Account field as well.

  • Kiran Support Team Lead
    Replied on October 12, 2015 at 2:35 PM

    I understand that you want to fill the email address field value in PayPal email address field. Please change the condition #6 as shown below :

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 30

    I notice that the existing condition was having the email address field as numeric value and displays the result as 0. Also, the second rule set on the condition is not allowing to edit the PayPal email field.

    Please see the result below by using the condition above.

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 2 Screenshot 41

    Hope this information helps! Let us know if you need any further assistance. We will be happy to help.

  • bdoodle
    Replied on October 12, 2015 at 2:55 PM

    Thank you!  By checking the option to add the field as text BEFORE I added the field, the defaulting works.  However, I'm still struggling with getting the PayPal Account field to leave the E-mail address and accept manual input.  

    I added a rule to the original condition that the PayPal Account field should only get its value from E-mail Address when Do you have a PayPal Account is NOT = YES.   ( Do you have a PayPal Account defaults to empty.)  My thinking was that the user would first enter the E-mail Address before answering that question... So the PayPal Account field would get the E-mail value default.  Then, when the user entered YES to the question, the condition would not be in force, the E-mail Address would remain in the PayPal Account field unless overridden by the user.  The fact is that the E-mail address disappears from the PayPal Account field when the user enters YES, and he can also not manually enter any value.  What gives?

    Thanks for your help.

  • Kiran Support Team Lead
    Replied on October 12, 2015 at 3:36 PM

    In this scenario, you'll need to add another condition with rule to check the radio button to No in order to reset the PayPal email field with email address field. The rule with PayPal field is empty is removed since either way, you want to display the email address entered.

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 30

    Here is the output with adding these conditions.

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 2 Screenshot 41

     

    Let us know if you are looking for something different. We will be happy to help.

  • bdoodle
    Replied on October 12, 2015 at 4:10 PM

    Thanks for your help.  I'm not 100% there though.  When they check Do you have a PayPal Account = NO, I don't want to allow the user to overwrite the E-mail address value there. 

    Also, I don't understand why the conditions are working the way they are.  Why does the form allow the user to overwrite the E-mail Address value in PayPal Account when the conditions now say to put the E-mail Address field value there whenever the E-mail Address field is filled when the Do you have a PayPal Account is either YES or NO?  I do want the user to be able to overwrite the default E-mail address in PayPal Account, but only when the Do you have a PayPal Account is YES.  

    What does filled mean?  Doesn't it mean whenever it has any value, plug the same value into the PayPal Account field?  

     

    Thanks for your continued help.

     

  • Kiran Support Team Lead
    Replied on October 12, 2015 at 5:28 PM

    Since the PayPal field is open textbox field and not restricted, user shall be able to edit the field. However, you can add another condition using change attributes to disable the PayPal field if the radio field is NO.

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 20

    Once the user selects NO, the PayPal field automatically returns to the value set in the email address and disables the field so that no changes can be done in PayPal field.

    The rule is filled in the conditions mean, if the field is filled with any value then do the action as in the condition set.

    Hope this information helps!

  • bdoodle
    Replied on October 13, 2015 at 11:12 AM

    I still have problems.  I changed my conditions as follows:

    UPDATE A FORM FIELD VALUE
     
     
     
    9
    CHANGE ATTRIBUTES OF A FIELD
     

    I thought that with these conditions, I was following your instructions but simplifying what I had.  Anyway, if the user selects NO, the PayPal Account is disabled as it should be.  It the user selects YES, he can alter the value in PayPal Account. But, if the user selects YES, changes the PayPal Account and then selects NO, the value in the E-mail Address field is not returned as I want to the PayPal Account field.  If at this point, I change the E-mail Address field by overtyping the same value or adding a space at the end, the value DOES reappear in PayPal Account.  

     

    Also, the way my conditions are set up precludes someone from entering their PayPal Account before entering their E-mail Address.  I don't understand how the above conditions cause the PayPal Account to be disabled before E-mail Address and PayPal Account fields have anything in them.

    Hence, my question about what "filled" means. I don't really need an answer to this, but I do need to understand how to fix the conditions so they work as I want and to understand why they work as they do. 

    Thanks very much for your help.

  • Kiran Support Team Lead
    Replied on October 13, 2015 at 12:44 PM

    I see that you are placing the rules in one condition which could be causing the issue. It is required to have separate conditions. I've cloned your JotForm and made the changes as required. Please take a look and clone it to your account to see how the conditions are set.

    https://form.jotform.com/52846400406955?

    Let us know if you need any further assistance. We will be happy to help.

  • bdoodle
    Replied on October 13, 2015 at 4:35 PM

    Thanks for your input.  I cloned your form and replicated your conditions in my form with one addition.  I only show the PayPal Account field if the user selects YES. My form and your form worked except for one thing:   When the user selects YES, enters a value in PayPal Account, and THEN enters a value in Email Address, the value in Email Address overwrites the value the user already put in PayPal Account.  

    I tried changing the condition that puts Email Address into PayPal Account when the user selected YES to only do it if PayPal Account was empty, but that made it worse (although I don't know why.)

    Please help.

    Thanks.

     

  • abajan Jotform Support
    Replied on October 13, 2015 at 10:46 PM

    It seems to me that the simplest solution to this dilemma would be to insert a separate field asking if the email addresses match, as I've done in this clone. Feel free to clone it in turn and examine its conditions.

    Cheers

  • bdoodle
    Replied on October 14, 2015 at 12:58 AM

    Thanks for your suggestion, but your conditions to not achieve all that I want for this PayPal purchase order form:

    --> E-mail Address is required

    --> PayPal Account is also required since I want the business owner to know what PayPal account was used in the transaction. The field appears on the notifying email and can be used by the owner in the future to invoice the customer directly or to give a refund.

    --> Since someone's E-mail address is usually his PayPal Account, I want to provide it as the default value there.

    --> If the customer's E-mail address is NOT the same as his PayPal Account, I want to allow the user to overwrite the default value and input the actual PayPal Account involved. 

    --> If the customer wants to use the PayPal interface to do a credit card transaction, for which no PayPal account is needed, I would leave the E-mail address in the PayPal Account field anyway so the field requirement does not have to be conditional. (<--This is not strictly necessary, and I could omit this requirement when they say they have no PayPal Account.) I would not show PayPal Account field when the user says he has no PayPal Account so as not to confuse the customer. 

    Please explain to me why the conditions I have (See below) do not work. Note that I don't think I need the 3rd condition disabling the field since I no longer show it unless the answer to the PayPal Account question is YES. The 2nd condition is not working properly in my mind. Jotform updates the PayPal Account value from E-mail Address even when PayPal Account is NOT empty, but filled with a different value. So, I cannot overwrite the E-mail Address value in the PayPal Account. I do not want to subject the customer to any additional questions to handle this functionality. 

    Also, I need to understand how Jotform interprets the condition statements so I can construct proper conditions in general.

    Thanks.

    UPDATE A FORM FIELD VALUE

     

    IFE-mail AddressIS FILLED 

    IFDo you have a PayPal Account?IS NOT EQUAL TO"Yes" 

    IF "ALL" of the "IF" rules are matched,

    INSERT{E-mail Address}INTOPayPal Account

     

     

    7

    UPDATE A FORM FIELD VALUE

     

    IFE-mail AddressIS FILLED 

    IFDo you have a PayPal Account?IS EQUAL TO"Yes" 

    IFPayPal AccountIS EMPTY 

    IF "ALL" of the "IF" rules are matched,

    INSERT{E-mail Address}INTOPayPal Account

     

     

    8

    CHANGE ATTRIBUTES OF A FIELD

     

    IFDo you have a PayPal Account?IS EQUAL TO"No" 

    DISABLEPayPal Account

     

     

    9

    SHOW / HIDE FIELD

     

    IFDo you have a PayPal Account?IS EQUAL TO"Yes" 

    SHOWPayPal Account

  • abajan Jotform Support
    Replied on October 14, 2015 at 9:34 AM

    Hi again,

    I think there's been a misunderstanding of how the "Check if emails match" field works. The "Check" there means to click the box to insert a check mark, not to see if the emails entered match. So, to address your concerns in order:

    E-mail Address is required

    That's fine. If any attempt is made to submit the form with the E-mail Address field unfilled, an error message will be triggered.


    PayPal Account is also required since I want the business owner to know what PayPal account was used in the transaction.  The field appears on the notifying email and can be used by the owner in the future to invoice the customer directly or to give a refund.

    No problem there either. The same applies as above.


    Since someone's E-mail address is usually his PayPal Account, I want to provide it as the default value there.

    I've updated the "Check if emails match" box to be checked by default. Therefore, by default, the PayPal Account field will be populated with whatever is entered in the E-mail Address field.


    If the customer's E-mail address is NOT the same as his PayPal Account, I want to allow the user to overwrite the default value and input the actual PayPal Account involved.

    In such cases the user can just un-check the "Check if emails match" box and enter the PayPal email.


    If the customer wants to use the PayPal interface to do a credit card transaction, for which no PayPal account is needed, I would leave the E-mail address in the PayPal Account field anyway so the field requirement does not have to be conditional. (

    Do you mean that you want the email entered in the PayPal Account field to remain when that field is hidden by the user selecting "No" for the "Do you have a PayPal account" field? If so, you would need to change the selection in the "Clear Hidden Field Values" setting in the form preferences to "Don't Clear", as shown below:

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 20

    However, be aware that that setting affects all of the form's fields and you may not want it to be so.

    Please explain to me why the conditions I have (See below) do not work. ...

    Let me peruse those conditions and get back to you after I've fully understood them.


    Thanks

  • bdoodle
    Replied on October 14, 2015 at 9:58 AM

    Thanks for your thorough response.  I think I understand what your Check if emails match field does, but I don't want to add that field.  It should not be needed if the conditions I specified worked as I think they should. The empty and filled parameters are not working as I imagine they should.  Condition 2 works the same whether the "IFPayPal AccountIS EMPTY" i  

     is there or not.  Why?

    UPDATE A FORM FIELD VALUE
     

    I definitely don't want to prevent Clears from happening in general.  I really don't care about the PayPal Account field value if the user doesn't have a PayPal Account.  I wanted to leave the e-mail address there, but that's really not necessary.

    I look forward to your explanations of the failure of my condition above to work the way I think it should. ie. If the user has a PayPal Account and PayPal Account field has something in it, do not overlay it with the e-mail address. 

    Thanks!

  • Kiran Support Team Lead
    Replied on October 14, 2015 at 11:24 AM

    Please allow me some time to look into this and get back to you. Meanwhile, let me also check with our colleague to see the best we can do for you.

    Thank you for your patience.

  • bdoodle
    Replied on October 14, 2015 at 11:45 AM

    Thank you!
    ...
  • bdoodle
    Replied on October 15, 2015 at 4:45 PM
    You didn't forget me, did you?
    ...
  • Kiran Support Team Lead
    Replied on October 15, 2015 at 4:49 PM

    Not at all. I was trying to review the conditions on your JotForm and will get back to you as soon as I find something helpful.

    Thank you!

  • bdoodle
    Replied on October 17, 2015 at 12:30 PM

    It's been 3 days since I put the above question to you. It would appear that you also see no reason why my existing conditions shouldn't work as I want.  Is that the case?

    UPDATE A FORM FIELD VALUE
     
     
     
    7
    UPDATE A FORM FIELD VALUE
     
  • David JotForm Support Manager
    Replied on October 17, 2015 at 9:39 PM

    Please remove part where it says "If Paypal Account is empty", that will allow you to do a manual input if need it: https://form.jotform.com/52897748276981?

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 20

  • bdoodle
    Replied on October 18, 2015 at 12:17 AM

    Hi,

      I tried that a couple rounds ago.  Conditions like that have the following results:

    If you enter E-mail Address and then YES to Have PayPal Account question, you can indeed overwrite the e-mail address in the PayPal Account.  

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 60

    1.  If you then change the value in E-mail Address, the changed e-mail address replaces the value in the PayPal Account. It should not. It should only be used to fill the PayPal Account field if the PayPal Account field is empty.

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 2 Screenshot 71

    2. Or, if you change the answer from YES to NO and then back again, the E-mail Address value replaces the new value in the PayPal Account

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 3 Screenshot 82

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 4 Screenshot 93

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 5 Screenshot 104

    It again comes down to the fact that the value in the PayPal Account should only be overwritten by the value in E-mail Address when the PayPal Account is empty.  But, if I add that Is Empty rule to the condition, the PayPal Account is not overwritable when it should be.  Jotform is not recognizing empty and filled the way I do.   Please explain how Jotform is dealing with empty and filled and why my conditions don't work.  Perhaps this is not working as the developers intended?

    I keep repeating the same question over and over.

     

  • Charlie
    Replied on October 18, 2015 at 4:46 AM

    Hi,

    The problem is that the "Paypal Account" field is tied to a condition. As long as the rules are being met, then it will get the value from the "E-mail Address" field. It cannot be overwritten using conditional logic as it is causing a conflict on it. And the conditions are triggered almost instantaneously.

    However, I might have a possible solution for this. Could you check this cloned form: https://form.jotform.com/52901515605955?. Please note that I disabled the "Auto Fill" feature on my form.

    Here's a simple form with that logic: https://form.jotform.com/52901721246955? 

     

    Clone the form and see if that's what you are looking for. If the setup of my forms are correct, then please let us know and I'll be happy to share how it works. Basically this is what it does:

    1. If Email address is filled and the "Do you have a Paypal account" is set to "Yes" then insert the value of "Email Address" to "Paypal Account" field.

    2. If user wants to change the "Paypal Account" field, then he/she just needs to input a different email.

     

     

  • Charlie
    Replied on October 18, 2015 at 4:55 AM

    I noticed you also want this condition to happen:

    "1.  If you then change the value in E-mail Address, the changed e-mail address replaces the value in the PayPal Account. It should not. It should only be used to fill the PayPal Account field if the PayPal Account field is empty."

    The problem here is that this will trigger the conditions, now if you ONLY want to trigger this condition when the "Paypal Account" is EMPTY, then that's a different case. And it is causing different conflict in the conditions. Let me find make a couple of test, but please do check if the test forms above is somehow close.

  • bdoodle
    Replied on October 18, 2015 at 5:35 AM

    I DO only want to put the E-mail Address value into the PayPal Account field ONLY when the PayPal Account is empty.  E-mail Address is the default value for PayPal Account.  The value there should NOT override any value already in there as your form allows.

  • Charlie
    Replied on October 18, 2015 at 7:31 AM

    Hi,

    So I narrowed it down to this problem:

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 1 Screenshot 30

    Here's my test form: https://form.jotform.com/52902510004944. I see you mentioned it overwrites the field.

    Basically, this is the condition that was set:

    IF "Paypal Account" is EMPTY

    AND

    IF "E-mail" is FILLED

    THEN

    INSERT "E-mail" value INTO "Paypal Account" field.

     

    However, when you fill out the "Paypal Account", this should make the condition invalid. But it looks like it is stuck on the first condition that we have. I made further test and some of it created a loop which made my form crashed or load slowly, similarly with the form you have (unless it is now been edited).

    Condition with multiple rules that uses Empty fails to stop if condition is already met Image 2 Screenshot 41

    I will forward this to our developers to see if they can investigate it further. We will update you as soon as we get more information on this.

    Apologies for the inconvenience.

  • bdoodle
    Replied on October 18, 2015 at 9:45 AM
    Thank you!
    ...
  • abajan Jotform Support
    Replied on October 18, 2015 at 12:25 PM

    Hi again bdoodle,

    While the issue of the condition still being triggered even though the PayPal Account field isn't empty is a bug, I think there's still going to be a problem after it has been fixed. Let's examine the following scenario:

    1. The user enters abc@xyz.com as their E-mail Address

    2. They select Yes for Do you have a PayPal account?

    3. The PayPal Account field is displayed pre-filled with what is in the E-mail Address field (abc@xyz.com)

    4. The user has a different email for PayPal than their regular email. So, they proceed to change the email in the PayPal Account field to suit

    Here's what is going to happen: They will click the end of the abc@xyz.com and hit [backspace].  On each press of [backspace] the address will change as follows: (keep the condition in mind)

    abc@xyz.co (condition evaluates to FALSE and is not triggered)

    abc@xyz.c (condition evaluates to FALSE and is not triggered)

    abc@xyz. (condition evaluates to FALSE and is not triggered)

    abc@xyz (condition evaluates to FALSE and is not triggered)

    abc@xy (condition evaluates to FALSE and is not triggered)

    abc@x (condition evaluates to FALSE and is not triggered)

    abc@ (condition evaluates to FALSE and is not triggered)

    abc (condition evaluates to FALSE and is not triggered)

    ab (condition evaluates to FALSE and is not triggered)

    a (condition evaluates to FALSE and is not triggered)

    Guess what happens at this point. Since the PayPal Account field is now empty, the condition evaluates to TRUE and is triggered, inserting abc@xyz.com back into the field. Of course, the same would obtain if the cursor were to be placed at the beginning of the email and the [delete] key pressed.

    I know you said you would rather not have the extra check box confirming that the emails match but I've made this simplified version of that earlier form for your perusal, in case we aren't able to resolve this to your satisfaction.

    Thanks

  • bdoodle
    Replied on October 18, 2015 at 12:58 PM

    Hello,

      You are right.  I only tested by overwriting some of the PayPal Account.  Also, I would gratefully accept the version you prepared above with one additional change.  If a (screwy) customer skipped the E-mail Address field, entered YES to having a PayPal Account, entered the PayPal account, and then unclicked that the Email and PayPal values were the same, the blank Email Address overlays the newly entered PayPal Account value.  i.e. We still need to put the E-mail Address value into the PayPal Account value only if PayPal Account is empty and Email Address is filled(and Email = PayPal Account).  Right?

    Thank you!  With your help, we are almost there!

  • abajan Jotform Support
    Replied on October 18, 2015 at 7:17 PM

    @bdoodle

    You're right too! Seems like our conditions tool is a bit "buggier" than previously thought. I'm guessing that's because it was recently significantly revamped. I believe the behavior exhibited by the form on this page is how you want your form to work. The page contains the form's full source along with a small script at the bottom. Unfortunately, until we get these bugs fixed you would need to do likewise with your form for it to function in that manner. We could help you with the script if you need to go that route.

    I'll submit a ticket shortly about the check box removing the value from the PayPal Account field without any condition directing it to do so. A test form I created revealed that this is a system-wide issue and not isolated to your form.

    Our apologies for the inconvenience caused.

  • bdoodle
    Replied on October 18, 2015 at 11:34 PM

    Thanks for your help.  

    Your form works but please answer me this: Should my form work as written, without the Email Address equals PayPal Account field at all? i.e. After the conditions tool is fixed, would my current conditions work as written? (Note: I am fine with leaving the email address in PayPal Account as a default value regardless of the answer to Do you have a PayPal Account.)  I ask because I need to understand how filled and empty should work in general for future use. 

    Also, do you have any sense on how long it might be until the conditions tool is fixed? I will not hold you to any estimate.

    I would prefer not to add the Email-and-PayPal-Account-are-same question in the end, and even in the short run, I don't want to use a script and go to full source.  I have 9 other forms to which I want to add PayPal.  I'd rather temporarily put in the conditions the way you had them along with the extra Email-and-PayPal-Account-are-same question even though under unusual circumstances (like I described in earlier Answer), the user might have to re-enter the PayPal Account after it was incorrectly wiped out.  

    Thanks again. I really appreciate your efforts to get things right.

    Reminder: my form is - http://www.jotform.com//?formID=52834694005962

     

  • Ashwin JotForm Support
    Replied on October 19, 2015 at 6:36 AM

    Hello bdoodle,

    The issue is already reported to our backend team and one of our developer is already looking into this with highest priority. 

    Let us wait for response form our back end team and once the issue is fixed we will test it again. I believe there is a conflict in the condition. 

    Though we cannot provide an ETA on this but we will get back to you as soon as we have any update form the assigned developer.

    Thank you!

  • bdoodle
    Replied on October 29, 2015 at 5:59 PM

    Any progress on this?

  • jonathan
    Replied on October 29, 2015 at 11:25 PM

    Hi,

    Currently there is no updated status yet from our developer assigned on the ticket.

    You will be notified when updated response is provided here.

    We apologize for the delays.