Can I use the "calculate field" condition to concatenate year, month, and day separately?

  • Profile Image
    alsch
    Asked on April 23, 2019 at 05:03 PM

    Hello!

    I'm trying to format a date on my form as YYYYMMDD and include it in a string. My goal is to create a field that combines the numerical date and other fields from the form, i.e.:

    YYMMDD_[uniqueid from form]_[name from form]

    However, with Calculate Field I can only use the whole date (including formatting) from the date form element. 

    I HAVE been able to extract year, month, and date separately and display them in a text field with the following code:

    {date:year}{date:month}{date:day} 

    However, it doesn't look like Calculate Field can pull from text fields.

    - Is there a way to extract year, month, and day values individually with Calculate Field?

    - If not, is there a way to pass a text field value above into a field that I CAN grab with the Calculate Field condition?

    - Is there another field type, compatible with Calculate Field, that will display {date:year}{date:month}{date:day}?

    Thank you!




  • Profile Image
    denis_calin
    Answered on April 23, 2019 at 05:58 PM

    Hi @alsch!

    The Form Calculation widget can pull text from Text Entry fields, simply add the fields you would like to pull from and change their type (either 0-9 or A-Z) by clicking on them. Like so:

    1556056489Screen Shot 2019-04-23 at 2.50

    Please take a look at the form I have created and see if this works for your needs! You can clone the form and use it.

    Form: https://form.jotform.com/91127182576965

    Guide: How-to-Clone-an-Existing-Form-from-a-URL