Create an Order Number using part of a name

  • Jerole
    Asked on December 5, 2016 at 9: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?

  • KadeJM
    Replied on December 5, 2016 at 9: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.

  • KadeJM
    Replied on December 5, 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} ".

    Create an Order Number using part of a name Image 1 Screenshot 30

     

    And the result looks like this when you receive it.

    Create an Order Number using part of a name Image 2 Screenshot 41


    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.

     

  • Jerole
    Replied on December 5, 2016 at 3: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.

    Create an Order Number using part of a name Image 1 Screenshot 20

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

    Yet - when I tested, I get nothing.

  • David JotForm Support
    Replied on December 5, 2016 at 6: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:

    Create an Order Number using part of a name Image 1 Screenshot 20

    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

  • Jerole
    Replied on December 5, 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.

  • omerorkun JotForm Data Scientist
    Replied on December 6, 2016 at 2: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. 

  • Jerole
    Replied on December 6, 2016 at 9: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.

  • omerorkun JotForm Data Scientist
    Replied on December 6, 2016 at 9: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.