How to merge 2 values together from the list of numbers?

Hello Bubble experts,

I’ve a list of latitudes & longitudes coming from API

Example:
2,284942723, 48,841615284, 2,28488764, 48,841558295, 2,284640581, 48,841292403, 2,284628566, 48,841274343, 2,284592908, 48,841291218

Can anyone help me to merge every 2 values together like this :point_down:

[
  2.284942723,
  48.841615284
],
[
  2.28488764,
  48.841558295
],
[
  2.284640581,
  48.841292403
],
[
  2.284628566,
  48.841274343
],
[
  2.284592908,
  48.841291218
]

Thanks for your help :pray:

Hey @viquarahmed07 :wave:

I am sure this is not the best way, but it will give you some idea. See screenshot below:

  1. Get the smaller values (this is a normal filter) since we need to cut the list into two parts to actually produce the end result you want. I get the values between 0 and 3, you might have another logic here.
  1. Then, use format as text in the resulting list.
  1. The tricky part is to find the 48.xxx part of each 2.yyy number.
  • image
  • For that, I have to split the list by the 2.yyy number which will give two lists and you get the last item.
    • image
  • Then, you split the remaining list with , and get item #2 and replace , with . again.
    • image

If you want to check the editor, here it is: Bubble Demos by Flusk | Bubble Editor

At least it should give you some thoughts.

bdk_512x512 @Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble

1 Like

@flusk Thanks a lot :pray: