Update / Calculate Field - how to calculate a field's value so that it is the first word in a field?

  • tsasf
    Asked on December 6, 2021 at 6:47 PM

    Hello

    The more I use your platform, the better it gets :)

    But might you be able to solve this question?

    If a user enters 'Given names' into the field below, I would like to be able to have the 'First name' and 'Other given names' populate automatically.

    1638834314 61aea08a8caf1  Screenshot 10

    How might that be possible?

    God bless

    Marc

  • Lorenz JotForm Support
    Replied on December 6, 2021 at 8:35 PM

    Hi there,

    If you simply want to pass the entered data in the "Given name" field to another field, then that can be done using the UPDATE/CALCULATE field condition.

    Here's a guide: https://www.jotform.com/help/286-how-to-pass-field-value-to-another-field/

    I hope this helps. Let us know if you need any further assistance.

  • tsasf
    Replied on December 7, 2021 at 12:07 AM

    Hi Lorenz

    Thank you for getting back to me.


    Unfortunately, the request is a bit more complex.


    For example, if someone enters in the Given names field:

    Mark John Anthony

    I would like to the First name field to automatically have the name:

    Mark

    And the Other given names field to then have:

    John Anthony


    Might this be possible?

    God bless

    Marc

  • Vick_W Jotform Support
    Replied on December 7, 2021 at 1:51 AM

    Hi Marc,

    With the short text field unfortunaltey that may not be possible. The only way I can think of is to use the Name field and use the following tags in the Paragraph field to show the entered name.

    {yourName:first}

    {yourName:last}

    With the short text field, it is not possible to separate them. We do have a substring widget that can be used to copy certain characters from the field, for example, the first four characters. But if the first name has more than four characters then the complete name will not get captured.

    Let us know if you have any questions.

    Thanks

  • tsasf
    Replied on December 8, 2021 at 1:33 AM

    Hi Vick

    Thank you for your response.

    Interesting workarounds which am thinking through.

    God bless

    Marc