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
[
2.284942723,
48.841615284
],
[
2.28488764,
48.841558295
],
[
2.284640581,
48.841292403
],
[
2.284628566,
48.841274343
],
[
2.284592908,
48.841291218
]
Thanks for your help
flusk
May 29, 2024, 10:11am
2
Hey @viquarahmed07
I am sure this is not the best way, but it will give you some idea. See screenshot below:
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.
Then, use format as text
in the resulting list.
The first part of the [
is straight forward, get the text and replace ,
with .
.
The tricky part is to find the 48.xxx part of each 2.yyy number.
For that, I have to split the list by the 2.yyy number which will give two lists and you get the last item.
Then, you split the remaining list with ,
and get item #2
and replace ,
with .
again.
If you want to check the editor, here it is: Bubble Demos by Flusk | Bubble Editor
At least it should give you some thoughts.
@Huseyin from Flusk | Discover the #1 Security and Monitoring Tool for Bubble
1 Like