Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Autopopulate a date


Not applicable
At the top of my form, I have a user defined field for the last date in a given week (Saturday)in the format MM/DD/YYYY. Below that there I have the days of the week (Sunday through Saturday). In this table each day should correspond with it's numerical counterpart.

For example, Saturday would be the user defined date, Friday would be the user defined date - 1, Thursday would be the user defined date - 2, etc.

So far I have a calculation in the "populated" area as FormCalc (where 'week' is the user defined date):

if(HasValue(week) then

$.rawValue = Num2Date( Date2Num(week) - 1) )

else $.rawValue = ""


With the current formula, I get nothing, no errors or calculations.

Additionally I'd like the autopopulated date to be in the format of MM/DD rather than MM/DD/YYYY.

Any Suggestions?
4 Replies


Level 7
You may have to provide the format of the string being converted to a number. You can also format the result of the 'Num2Date()' function.


Not applicable
all of the fields are text input boxes with FormCalc and *calculate formulas...however given the formula above, i don't get anything, so should i change the formula all together or is there a better way to get these results? i'm new to the form building and XML stuff, so thank you for your patience


Level 7
I have found that using the formatted value are more reliable for the date and time functions.

And if you try different strings within the "Num2Date" funtion you can get different parts of the date from numbers for everything to long words for the month and day of the week.


Not applicable
ok, well the big problem is getting the general formula to work...i can't get it to autopopulate off of the user inputed date.

user inputs 03/31/08 the seven autopopulated fields would be 3/31/08, 3/30/08, 3/29/08, 3/28/08, 3/27/08, 3/26/08, 3/25/08

so i just need to figure out the formula that will do that for me