Nintex Employee
Nintex Employee

Auto calculate Age from Date of Birth date field

Got to the bottom of this one with @EuanGamble  so thought it worth sharing.


My form has a Date control to capture Date of Birth and I wanted to auto calculate the age rather than have the end user fill it in. How did we (and I say we, it was a team effort) do it:

Start by creating a variable:
Use the Function dateDiff then add the form control for Date of Birth followed by Context value Current Date. Variable looks like dateDiff("TotalYears",[Form].[DateofBirth],[Context].[Current date])2019-12-04 16_12_04-Window.png


I then need to create a rule to ensure my Age control is populated when I input the DOB.

If Date of Birth is filled, then Age value is <my variable>.2019-12-04 16_13_45-Window.png


Finally, set my Age control to read only on the form...2019-12-04 16_16_58-Window.png


And when I put my date of birth in it shows:2019-12-04 16_20_56-Window.png


1 Reply

Re: Auto calculate Age from Date of Birth date field

Glad you had success with New Responsive Forms, @cgellis 😄


0 Kudos