Calculate and auto-populated formatted dates

  • aweyers
    Asked on July 24, 2024 at 12:25 PM

    In my form, I am asking the user to fill out a Monday start date in the "Month Beginning" field, then bring THAT date into the Row1/Cell1 of my "Order" table. So far, so good - I'm able to do this without trouble.

    What I'd like to do on this form is to then take the date in that Row1/Cell1 and then autofill down that column.

    If Row1/Cell1 = 7/22/2024, Row2/Cell1 = 7/23/2024, Row3/Cell1 = 7/24/2024, Row4/Cell1 = 7/25/2024, Row5/Cell1 = 7/26/2024, Row6/Cell1 = 7/29/2024( following Monday), etc...

    The part that I'm having trouble with (and it could just be syntax) is then auto-filling in the dates of the subsequent rows of the table. I'm trying the "adddays" function, but seem to need a little push to get it correct.

    The BONUS question is to ask whether there is a way to format the dates with only a YY at the end, instead of the YYYY format?

    Thank you for your help!


    Jotform Thread 17228001 Screenshot
  • Angelica JotForm Support
    Replied on July 24, 2024 at 2:26 PM

    Hi Anton,

    Thanks for reaching out to Jotform Support. I understand what you need, but I’ll need a bit of time to work out a solution. I’ll get back to you as soon as I can.

  • aweyers
    Replied on July 24, 2024 at 2:30 PM

    Thank you, Angelica

  • Angelica JotForm Support
    Replied on July 24, 2024 at 3:47 PM

    Hi Anton,

    I cloned and tested your form. After investigating it a bit, I found a solution. It's really easy to fix. Let me show you how:

    1. In Form Builder, in the orange navigation bar at the top of the screen, click on Settings.
    2. Click on Conditions on the left side of the screen.
    3. Next, click on + Add Condition.
    4. Select Update/Calculate Field. Calculate and auto populated formatted dates Image 1 Screenshot 50
    5. Then set your condition based on this Formula: addDays(Date, Days to add) just like the screenshots below: Calculate and auto populated formatted dates Image 2 Screenshot 61Calculate and auto populated formatted dates Image 3 Screenshot 72

    Here's the result:

    Calculate and auto populated formatted dates Image 4 Screenshot 83

    You can clone and check my demo form for your reference. We also have a guide about Performing Date and Time Calculations that you can check out.

    Give it a try and let us know how it goes.

  • Angelica JotForm Support
    Replied on July 24, 2024 at 3:49 PM

    Hi Anton,

    As for your other question, I've moved that to a new thread. You can check that out here.

    Let us know if there’s anything else we can help you with.

  • aweyers
    Replied on July 25, 2024 at 11:05 AM

    Thank you, Angelica -

    That solution will work, however I'd still like to format it in the MM/DD/YYYY method. (I will accept for now, that I can't have YY). Is there a way to do that, similar to how it appears in the first row?

  • Joeni JotForm Support
    Replied on July 25, 2024 at 11:15 AM

    Hi Anton,

    It seems like my colleague already answered your other concern in a different thread. You can check it here.

    Let us know if you have any other questions.

  • aweyers
    Replied on July 25, 2024 at 11:20 AM

    Thank you Joeni -

    Angelica did move a similar question to another thread, yes. What I am asking is in reference to my fist question about the adddays formula.

    Angelica provided a decent solution, however, her solution gives me a different format.

    Please see screenshot of differences I am describing from Row 1 (7/22/2024) and the subsequent rows.

    Calculate and auto populated formatted dates Image 1 Screenshot 20

  • Bilal JotForm Support
    Replied on July 25, 2024 at 11:57 AM

    Hi Anton,

    The addDays formula has a default format which includes the Days name and year with the YYYY format. If there's a workaround for it, Angelica will update you on this thread.

    Reach out again if you have any more questions.