Create an Order Number using part of a name

  • Profile Image
    Jerole
    Asked on December 05, 2016 at 09:15 AM

    Hello,

    I want to create an order number that contains the unique id number and the first 4 letters of the customer's last name.

    Possible?

  • Profile Image
    KadeJM
    Answered on December 05, 2016 at 09:55 AM

    To my current knowledge I believe this should be possible but, please allow me a little bit of time to check up on this to help you out better.

  • Profile Image
    KadeJM
    Answered on December 05, 2016 at 10:40 AM

    So here's a quick example below just to show you that this is possible.

    https://form.jotform.com/63393871054965 

     

    In this example I just used two textboxes to get the first and last name to show you how the last name can be carried into the unique id using it's field tag such as " {input6} ".

     

    And the result looks like this when you receive it.


    As for getting the first 4 letters of the last name you can try doing that with the form calculation widget using one of it's advanced math functions.

     

  • Profile Image
    Jerole
    Answered on December 05, 2016 at 03:30 PM

    I actually wanted the Name to come last. But even when I tried above. I did not get the result.

    I looked through the math functions and did not see what I would use in a DataBase function.

    I set up another field. With this Calculation:

    The format of the UID is CD-01

    so I just want CD-01, 02, or 03 and the truncated last name.

    I put a limit on the characters allowed so the name would truncated.

    Yet - when I tested, I get nothing.

  • Profile Image
    david
    Answered on December 05, 2016 at 06:37 PM

    For the unique ID, you wouldn't use a condition.  You would use the field ID for your last name field as the prefix for your Unique ID.  Unfortunately, it won't work as a postfix.  Here is an example in a copy of your form:

    The ID of your last name field is {lastName} and then add whatever other text you would like to accompany it.  In my example, I set the prefix to {lastName}-CD-

    Make sure to remove any conditions associated with the field.

    Here is my test form if you would like to see how it works:

    https://form.jotform.com/63397331629968

  • Profile Image
    Jerole
    Answered on December 05, 2016 at 10:06 PM

    It works when I use the actual field name and #. My problem was being able to see it and place it in a text field. What I found was these are generated on submit so moving to a visible text field doesn't work.

    Thanks for the help again.

  • Profile Image
    owen
    Answered on December 06, 2016 at 02:47 AM

    Hi, 

    You are right about it, Unique ID widget generates the "code" when the form is submitted. I can see that you have successfully configured the widget when I cloned the form. 

    Please contact us again if you need any further assistance. 

  • Profile Image
    Jerole
    Answered on December 06, 2016 at 09:05 AM

    My light bulb went off and I realized all online shopping gives you the order number on the confirmation/thank you page. So I did that and now the client knows their order number.

    Thank you all.

  • Profile Image
    owen
    Answered on December 06, 2016 at 09:10 AM

    It's great to know that the issue is resolved.

    Please contact us whenever you need assistance. We are glad to be helping you.