Cognito-forms – How to get an incremented date range using a table field in Cognito Forms

cognito-forms

I am creating a timesheet template for my organisation. The user should be able to add 10 entries (one for each weekday in the fortnight worked), plus the hours worked.

Using a table, I have created 10 blank entry rows. I would like to populate the date field in each row with a date incremented from the start date specified in the first row (e.g. row 1 = 16/05/2019, row 2 = 17/05/2019, row 3 = 18/05/2019 etc.). The calculation only needs to increase the date by 1 per row, and doesn't need to skip weekends or holidays.

Is this possible and if so, how?

Best Answer

Found the answer!

I added a field for the pay start date outside of the table, then added the table row number to the calculation as follows:

=Form.StartDate.AddDays(ItemNumber-1)

When placed in the table 'Date' field as a default value, this pre-filled the entire table as needed.