Text element save conditional in field

Hello community, I don’t know if you can help me. I try to find info but I still can’t find it. I want to do a dynamic calculation that varies according to age. Example is the following, I have a user who adds his date and the system automatically calculates the age. The next step is to categorize them into groups and generate a field that reflects this group, eg if you are 18 to 30 Young, 30 to 40 young adult and so on. So far only he managing to do this in a text element, which has several conditions, then by hand I copy the data and add it to the field, but the idea is that it is all automated and not one is copying. They come up with an idea.

Hey @estudio315

Cool idea and definitely something worth trying to automate a little more. I haven’t personally done this sort of calculation, but if I were to do it, my first stab would be with an option set. You could set up an Age Group option set where there’s potentially two number attributes for helping distinguish what age is too old and what age is too young for each option.

From there, you would calculate their age and get all options:filtered where the filter would be something to the effect of user’s age is older than the too young number and younger than the too old number. If you’ve set up your two attributes correctly, using a filter like this should basically return one option that will have the appropriate group name (ie Young, Young adult etc)

Keep in mind with this approach, you might also want to consider a way to switch users to the next group at a certain time? Not sure if you need that complexity or not, but figured it was worth mentioning.

Give this a try and don’t hesitate to reach out to us directly at Support@Bubble.io if we can assist with anything else.

Thanks, I solved it, in a similar way. I had to create an age field and then conditions in the workflow that, as appropriate, if the age is greater than 15 and less than 29, I classify it as young, this is done through a trigger. I do all this later to work with the zeroqode plug-in, and the filters are fast. Now that if I am stuck in the selection with the algolia data, since they arrive as text, and I want to create a selection of the profiles that the client chooses. Can you think of anything? I must say that I love bubble, I came from filemaker and basic javascript programming. there are things that need to be improved, but overall I love the system.

Thanks for the update @estudio315

Mind shooting us an email at Support@Bubble.io with some more detail on what specifically you’re trying to do with the algolia data and data selection? I’m sure we might be able to point you in the right direction on that but want to make sure we have a good grasp on the specific need first.

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