Then, on the homepage there is a search box where you can find your real estate agent when you enter your zip code. The results page display real esatate agents of your area in a RG.
Now, I would like to sort this RG with differents data.
I would like to display real estate agents of your zone but only with one of a price category. I tried to add a new constraint in my RG, I found of course “prices category” (tarifs categorie) but I didn’t find the way to setup one of my 3 statics choises.
Then, I would like to display real estae agents of your zone and I would like to sort them by their number of sales.
I got a problem, because the sum of “sales” (ventes) is in an other data type.
I’ve no problem to display the sum of sales for each real estate agent profile (on their profil page).
Assuming that you’re going to have the user choose which price category they want to filter by, why not store that value in a custom state? You can do this on any element on the page. Let’s imagine that you have a group somewhere on the page called “Group A”. You could set a custom state on “Group A”. The custom state could be a text, and you could call it price_category. Whenever the user selects a price category to filter by, you could set “Group A’s price_category” to the value that they choose.
When you’re setting up the data source for your repeating group, then, you could set a constraint that would be “tarifs categorie = Group A’s price_category”. You could also have a condition on the repeating group to control for when the user hasn’t selected any filtering option: “When Group A’s price_category is empty” (set the data source without any price category constraint).
Regarding your other question, it seems like you’re already storing the # of sales as a field for each real estate agent, and that this is the field you want to sort by (unless I’m missing something). All you’d need to do is select “Ventes” in the sort by dropdown when setting up your repeating group’s data source.
I reply to my own post because after fews emails with bubble support team, I found my solution.
I share it here for someonelse whot got the same issue.
I had a RG where I wanted to display real estate agent and I wanted to sort them by their number of sales.
My issue was : my number of sales was a field in an other datatype than my real estate agent data type. That means when I choose the type of field to sort them in the dropdown, it doesn’t allow me to choose a field in an other datatype.
Now I can do it, beacause I’ve just had a new field in my real estate agent datatype, wich is “number of sales” as well.
Every time there is a new sale in my sales datatype, I add a new worflow to modify this field in mean time (in real estate agent datatype).
Thank you to the bubble team and Eve Korina who spend her time to help me.