Skip to main content
Nintex Community Menu Bar
Solved

Calculating Age in K2 Smart Form ?

  • June 25, 2018
  • 2 replies
  • 100 views
  • Translate

I have a DateOfBirth field, on the form load I am fetching DOB of Customer and based on some check hididng and showing some fileds on the form.

My Requirenment is to calculate the age based on DOB on form initializing and show/hide some fields. Please suggest me proper a way to calulate the age from DOB ?

Thanks

Shubh

Best answer by RaymondJVR

Good Day Shubh


 


You can use the day difference expression to determine the day difference between the current date and the date of birth, this will return a number value. This number value would then need to go through a conditional check to see if it is less than 365 (total amount of days in a year) in which case the result would be displayed in days OR if the number value is greater than equal to 365 then the result would be displayed in years.


 


Please see the below configuration steps in order to setup the above explained (Please see the below screenshots):


Show content

Step 1
On the initialize rule for the viewform the Data of Birth would need to be returned form the specified SmartObject and then needs to be diplayed in a control.


The above configuration will result in the following behaviour (Please see the below screenshots):


Show content

When the user is a few days old


 


Kind Regards


Raymond


 

View original
Did this topic help you find an answer to your question?

2 replies

  • 51 replies
  • June 25, 2018

Good day,


 


You can calculte age using expression that calculate difference between dates. You will subracct date of birth from system current date.


Please see below documentation for more information of time and date expression:


http://help.k2.com/onlinehelp/k2smartforms/userguide/current/default.htm#SF-ViewDesignerLayout-CalcExpression.html?Highlight=expression


 


Kind regards


Themba

Translate

RaymondJVR
Nintex Employee
Forum|alt.badge.img+13
  • Nintex Employee
  • 412 replies
  • Answer
  • June 26, 2018

Good Day Shubh


 


You can use the day difference expression to determine the day difference between the current date and the date of birth, this will return a number value. This number value would then need to go through a conditional check to see if it is less than 365 (total amount of days in a year) in which case the result would be displayed in days OR if the number value is greater than equal to 365 then the result would be displayed in years.


 


Please see the below configuration steps in order to setup the above explained (Please see the below screenshots):


Show content

Step 1
On the initialize rule for the viewform the Data of Birth would need to be returned form the specified SmartObject and then needs to be diplayed in a control.


The above configuration will result in the following behaviour (Please see the below screenshots):


Show content

When the user is a few days old


 


Kind Regards


Raymond


 

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings