Add just first name to calculated field

  • rossyellin
    Asked on September 18, 2024 at 2:02 PM

    Hi,

    I am trying to add just the first name field to a calculated field. I was only able to find the option to add the entire name (First and Last name).

    As a work around I made the First and Last name as separate text field and used CSS to try and make it look just like the Name field option. I attached a picture showing this

    Can you first let me know if there is a way to add just the first name to the calculated field? If this is not possible can you provide me the code to do this work around. I cant remove the margins any more, the label styles are off and the field break into 2 separate lines when I view it on a phone


    Add just first name to calculated field Image 1 Screenshot 20

  • Arghya JotForm Support
    Replied on September 18, 2024 at 3:02 PM

    Hi Ross,

    Thanks for reaching out to Jotform Support. You can send first name into the calculated field using the Substring widget. Let me show you how:

    1. In Form Builder, click on Add Element.
    2. Go to Widgets tab and add Substring widget in your form.
    3. Click on Gear icon in Name field and go to Advanced tab.
    4. Scroll down and copy the first name Field ID.

    Add just first name to calculated field Image 1 Screenshot 30

    5. Then click on Wand icon in the Substring widget and paste the first name Field ID in Source Field ID.

    6. Now, enter 0 in Substring start and 50 in Substring end. This will capture up to 50 characters in the First Name field. You can change the substring end as per your requirement.

    7. Click on Wand icon in the Form Calculation widget and click on Add Field.

    8. Select the Substring widget and set it to A-Z, and click on Save.

    Add just first name to calculated field Image 2 Screenshot 41

    You can check out this guide for more information. May I know which margin you want to delete? Can you take a screenshot from your mobile of what’s happening and send it to us? This guide will show you how to do that.

    Give it a try and let us know if you need any help.

Your Answer