Forum Academy Marketplace Showcase Pricing Features

Modify array of objects coming from request

Hi,
My problem is: how to modify an array of objects directly coming from a request ?

A little bit of context:
When a user requests a product to be delivered, I want to show all the relay points available, and to sort those by proximity.
I have access to latitude and longitude of both the client and the relay points. But to sort by proximity, I need to perform a heavy calculation due to the Earth being spheric (sorry Flat-Earthers :speak_no_evil:).

  • Is it even possible in Bubble ? Didn’t see many options about this kind of calculus.
  • How to do the calculation, add it as a property to the object, and then sort ? (just as map function would do in a programmatic language).

Thanks in advance for your answers !

1 Like

This approach can work … then can use javascript or node to do calcs on the data.

2 Likes

I didn’t see your answer ! Thanks Misha :)))