What Would It Take To Sort By A Calculated Value In Bubble?

Gotcha.

How many calculations would you need to make ? i.e. how many aircraft could make the trip.

Is it possible to do a high level sort to knock out aircraft that are in … say… Tokyo at the moment.

1 Like

Yes it would span outward from nearest to the departure city/airport, as that would result in the lowest price, but the total results can be over 5000 in the database, as you can get specific with the aircraft type and request a special aircraft that comes from, say, Dubai to NYC, NYC to London England, then back to it’s base in Dubai.

So all of the aircraft need to be eventually parsed and calculated and then sorted. It could be done in paginated format (just an idea) or 100 entries at a time, but it still doesn’t help because bubble can’t sort the calculated values it seems.

Any way I can get this done i’m open too - such as an api, or anything else. I just can’t figure this one out.

Hi @JustinC

I have been trying to get this right but have not come right. I tried many options for what you have mentioned above. This is one of my approach below. Please advise where I got it wrong.
image

I have saved the addresses using the geo-addresses.
image

Push out to Airtable/Parabola ?

1 Like

Parabola would work well, i agree, and I had tried them, but they suggested it wouldn’t be quick enough and isn’t geared toward such speed.

I will investigate Airtable - something tells me i’ll run into a speed issue here as well - I just wish that we’d have input from the bubble team on what this will take to achieve. Sorting by a calculated value is such a sticking point based on the forum posts and feedback.

@mxolisipn Here is what I’m doing:

1 Like

@NigelG besides writing back to the database I’m aware of pulling a value out of the repeating group using bdk plug-in (haven’t tried it.) What others? Seems like this would be a handy topic to build mastery of the workarounds.

I am using the bdk solution to great effect to sort on fields in a related data type.

1 Like

What is the bdk solution?

1 Like

I am using a combination of these 2 plugins:

Quick summary (I can provide a more exhaustive explanation if there is interest and when I have bit more time available):
In addition to the main RG on the page, I have a second hidden RG.
The main RG has the primary data type for its source, while the hidden RG has the related type.

Within the first plugin is the “RG Extractor”. I use this to get the related data out of the hidden RG.
Within the second plugin is “Transform Lists”. I use this to stipulate the sort order.
Then in my main visible RG, there is a condition (actually multiple) to activate the related sorting based on user selection. Took a little while to get working, but thanks to some wonderful support from @gaurav it works perfectly and super quick too.

1 Like

This is great news.

But just to confirm before I dive into this, this setup will also work to sort calculated values (values not stored in the database) inside of the primary repeating group??

Those 2 methods you mentioned are the only ones I know of, and I’ve used both of them. Would be interested to know of any others.

Sorry, I really don’t know the answer to this. I’m not that optimistic, because the solution relies on the RG extractor which gets existing data already in the related type.

OK so it doesn’t seem to be possible as the values are calculated in the RG and displayed to the user… Damn.

I’d love any way to sort a calculated value on-screen from lowest to highest.

1 Like

@JustinC Actually, it might work…

Here is a screen shot of the RG Extractor element and I updated the last column to be a calculation.

Here is a screen shot of the RG data element which gets the data from the RG extractor. It looks like it will take the calculated field.

2 Likes

Awesome, thanks for the help on this @SerPounce!

Will start playing around!

1 Like

Just posted this that might be helpful :smiley: :

5 Likes

Thanks a lot @eric1.

I can now sort per the nearest physical addresses. :handshake:

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