Find Oldest User's Age Dynamically

In my database, I am searching for the DoB of each user. I am trying to use the “oldest” age of all users as the top end of a Slider Input. That way, if my eldest person is 34 or 134 it would make each possible.

In your repeating group’s data source maybe try “Do a search for User” and have the constraint “Age ≤ to SliderInput’s value” and sort by Age, descending = no? That would work I think if you are storing their age and not their date-of-birth.

I’m actually using a slider in this particular case. I’m trying to set the max end of the slider to be equal to the eldest age, currently I only have DoB as an entered variable, but if there is a better way, like calculate age and store it somehow, I am good with that, also.

I’ve decided to run it this way (it is the last item in the list). This will just store the age, and actually save me some time in other spots…

Yea I think that’s fine. Some people store the actual date and always subtract it I think on the spot but I’m not sure what the best way is.
You’re trying to set the max range of the slider? Put the slider in a group with the type “number” and make the max range of the slide dynamic and make it “Parent group’s number”
Then make the groups data source “Do a search for User” Sort by Age decending “no” then do :first item’s Age

Or actually you can probably just make the data source I mentioned the actual dynamic value right in the slider instead of the group

For the Slider, now that I have an actual age, I can do a search for MAX dynamically inside of the slider. It didn’t want to do the math inside of the slider itself was where I was running into issues.

Yea I was having issues with math inside elements, then I turned on the experimental parenthesis support in the app settings and then I was able to do a lot more things. Did my solution work or am I misunderstanding?

To some degree, was not exactly what I was looking for, but I got a good direction from it

:+1: Okay let me know maybe I can help more

Of course! I’m going to mark the first one as a solution, it works, just a little different than what I myself happened to need, but a solution did grow out of it.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.