Checking age of the user of the application (dynamically)

Hi,

Totally new here and I’m sure there is an easy way to do this:

I am building an application to automate parts of the creation of a Will (‘testament’). It is only possible to create a Will if you are older than 21 years. So, I want to create a rule to test if a person is older than 21. The applicant already has given me his or her day of birth, so I do have access to that data/information. Now, what would be the easy way to calculate the age of the applicant? I have been fiddling around with dates but I can’t find an easy way to do it. (‘Geboortedatum’ means ‘day of birth’)

See the screenshot above to explain my issue. (‘Geboortedatum’ means ‘day of birth’)

I am going to VALIDATION RULE since I want to check the age and give an announcement if the applicant is too young. (is that my mistake?)

ADD CONTENT => Current date – Day of birth > +

TYPE : specific content

SPECIFIC DATE : that is not what I want, I want to simply fill out 21 years . Not a date. I simply want to subtract date A minus date B and see if there are more than 21 years between those two dates. How do I do that?

Hi Paul,

I think I could help you with this. Triggre has a standard function that you can use, called “add n years to A”. Therefore you can add, for example, 21 years to your birth date. When the current date is greater than your birthdate + 21 years, this means that you are older than 21.

74rgzdqncbl3o4jjldlccmfy200zeu221

I added this into your user flow.

Does this help?

We also now have an article on our knowledge base about this, which goes into a lot of depth of how to make age calculations:

https://www.triggre.com/knowledge-base/tips-tricks/flows/how-to-calculate-age