Generating coupon codes with conditional logic update fields

  • Profile Image
    Asked on October 11, 2014 at 09:42 PM

    I'm trying to make a simple coupon code generator to allow customers to generate a code they can forward on to their friends to use and then get a discount.
    I figure if I include the email address in the code then it'll keep it relatively unique then add a first name and a coupon title.
    I've tried this but I only get zero in the coupon field i've created.

    I'm working on this test form - if you could tell me whether I'm wasting my time or not, that would be great.

  • Profile Image
    Answered on October 11, 2014 at 09:47 PM

    OK - I've just figured it out.
    I needed to select (in the advanced options) to "Add field to equation as text by default."

    That did it.
    I'll share this form for anyone who wants a simple way to generate a coupon code.  It seems to do what I need.

  • Profile Image
    Answered on October 11, 2014 at 10:31 PM

    NEW problem...
    I thought I might try to use the unique ID field and add that to the coupon value via the conditional logic but not working.  I actually don't see it as an option to insert so I'm wondering if there is a way to make this work?


    This is the form editor showing the fields I've created...


    This shows what I'm trying to do (the "UNIQUE ID" text represents where I want to insert the unique ID value)


    ...However when I try to insert the unique ID field, it's not visible in the list of options.
    In addition to this you will see the field identified by "clickTo" below.  This identity/label is not displayed in any of the settings for fields I've added to the form yet it appears to the ID for the checkbox field I've enetered which is a button checkbox widget.  I don't think it has anything to do with the problem but just mentioning this to ensure you that "clickTo" is NOT the unique ID field (which I've labelled as "Coupon Auto")


    Any ideas as to how to get the unique ID to display here?

  • Profile Image
    Answered on October 12, 2014 at 07:19 AM

    Hi Danny,

    I have already moved your question about Unique ID field from the other thread to a new thread here

    I would suggest keeping that thread for helping you to change the source code and use the Unique ID field, if that is something you are interested.

    Now regarding coupon code.

    I would suggest using a widget designed for this, called Random Value Generator.

    You can see here how to add a widget to your jotform.

    You can see a quick sample of it working here:

    If you want to clone it to your account you can do that by following these steps: How to Clone an Existing Form from a URL.

    Do let us know if you have any further questions.

    Best Regards,

  • Profile Image
    Answered on October 12, 2014 at 08:35 AM

    Thanks Ben.
    That looks promising.  I'll give it a shot.
    Just for my own satisfaction - is it possible to use the unique ID field as I was attempting to?

  • Profile Image
    Answered on October 12, 2014 at 09:43 AM

    Unfortunately, including Unique ID in the calculation is not possible. You can only select field with input values. Please consider my colleague's suggestion instead :) That should work.

    Thank you!