Is there a way to calculate a users age based on their Date of Birth (DOB)?
So my app is a habit tracker and based on the user’s age they will be able to select different habits to track. I’m asking users to input their DOB on registration and ideally I don’t want to then have to ask them to input their age as this will cause issues when their birthday comes up and they are a different age.
Ideally, I would like to calculate their age based on DOB and store this in the user table. Then my UI would display different habits based on their user age e.g. 13-16, 16+.
I’ve searched through the documentation and the support forum but can’t find anything related to this.
My app ID is: C209BEBE-88E7-1122-FF98-41304F96CA00
I’ve set this up and got the 200 success code. But it didn’t save in the age column of the user’s table. I think I need this to save in the user’s table so my frontend app (Appgyver) can read this to display the correct content for that user.
Apologies for all the questions but i’m a rookie at this coding stuff
Hello, Vladimir! I’m trying to do the same thing in a generated column. And I’m curious if it’s possible to make more accurate value (not only full years but months as well)?
I tried (and failed) to transform my formula from Airtable platform that shows an age in a “years.months” format. Do any equivalents of rounding formulas exist in Backendless?
Also, I didn’t get how to use this ticket’s number thing in a ‘2021 - year()DOB’ formula If a year is replaced by “curyear()”, the column doesn’t recognize the function.
You would not be able to use the TODAY() function in a generated column. The system doesn’t allow non-deterministic functions. Here’s a definition of a deterministic function:
A function is deterministic if, given the same data in tables, multiple invocations produce the same result, independently of the connected user
A workaround is to use a formula to request a dynamic property. For example, consider the following scenario - a table contains the dateOfBirth column:
Hello Mark!
Thank you very much for the response, it provided food for thought
I’ve been thinking if this “age” value can’t be dynamic in a data table I can use some tools in a UI builder to generate and show it.
I created this form with a date and a read-only block which should calculate an age.
But I got lost in a Value Logic of the second field. (No matter what’s inside, I just can’t display it) I’m pretty sure that the result needs to be returned but it’s not possible with IF statement as I can see.
Hi, Dima! Thank you for your advice. I switched from Input to Text and added a return. I should have known that I needed to GET that property
Now everything works and I’m completely happy!