# Problem with for each item in list (Adding several markers to map from a list)

**URL:** <https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212>\
**Category:** Questions about Thunkable X\
**Created:** [August 9, 2018, 8:21pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212 "2018-08-09T20:21:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_Holbech](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus\_Holbech](https://community.thunkable.com/u/Claus_Holbech)\
**Post date:** [August 9, 2018, 8:21pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/1 "2018-08-09T20:21:12Z")

</div>

Does anyone here knows what I am doing wrong here?.

I have a list of coordinates, that I want to add to a map.  
The list looks like this:  
{“lat”: “55.6097280000”, “long”: “12.6155090000”}|{"lat: “55.6172440000”, “long”: “12.6039670000”}

I use the following code to add the markers to the map, but it only adds the first marker.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/9/a972f5816690308d0e565c81b2ae1bf5433a62db.png)

If I add the list to a list view, then it shows both entries, but it just dont work with for each item in list.

What am i doing wrong?.

---

<div class="post-metadata">

**Author:** ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)\
**Post date:** [August 10, 2018, 8:27am UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/2 "2018-08-10T08:27:20Z")

</div>

Perhaps the addMarker block is a block with an asynchronous action. You can try adding data to it using a timer. Add a call to the timer once in the cycle, and in the timer processing block place the block for adding the marker.

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [August 10, 2018, 5:37pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/3 "2018-08-10T17:37:46Z")

</div>

Claus,

I don’t think it’s an issue with the `addMarker` block being asynchronous. This project I created is pretty much the same as yours, except is doesn’t get the data from the web, and it adds two markers just fine for me: [https://x.thunkable.com/copy/a1721785b9644e336dcfcecb9a34379e](https://x.thunkable.com/copy/a1721785b9644e336dcfcecb9a34379e)

Can you check to see if my app works for you?

-Mark

---

<div class="post-metadata">

**Author:** ![Claus\_Holbech](https://avatars.discourse-cdn.com/v4/letter/c/82dd89/32.png) [@Claus\_Holbech](https://community.thunkable.com/u/Claus_Holbech)\
**Post date:** [August 11, 2018, 10:41am UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/4 "2018-08-11T10:41:26Z")

</div>

Thank you, That helped me to sove the issue. Which was an error in the api data.

Claus

---

<div class="post-metadata">

**Author:** ![Shreya\_Santhanagopal](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Shreya\_Santhanagopal](https://community.thunkable.com/u/Shreya_Santhanagopal)\
**Post date:** [April 22, 2019, 2:31pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/5 "2019-04-22T14:31:32Z")

</div>

Hi, I am having a similar problem. I am not able to place multiple location markers for the location data saved in the firebase. Is there any way to do this in Thunkable X? Please let me know as soon as possible.

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [April 22, 2019, 4:48pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/6 "2019-04-22T16:48:39Z")

</div>

> [@Shreya\_Santhanagopal](#):
>
> I am not able to place multiple location markers for the location data saved in the firebase. Is there any way to do this in Thunkable X?

This is certainly possible. Can you describe what the problem is that you are having? If you could create a very simple project that shows your problem and then [share it](https://docs.thunkable.com/share-1) with us that would help us diagnose it.

-Mark

---

<div class="post-metadata">

**Author:** ![Shreya\_Santhanagopal](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Shreya\_Santhanagopal](https://community.thunkable.com/u/Shreya_Santhanagopal)\
**Post date:** [April 22, 2019, 5:18pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/7 "2019-04-22T17:18:47Z")

</div>

![05%20PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/5/45f934f8301f37d0a6cfb28cf6826604caafedaf.png) ![12%20PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/b/cb7e944cf7ebb1356df1ab504d1c5000cdcafcac.png)

Thank you so much for your reply. Actually, I switched from using a Firebase to using a Spreadsheet. This way it is easier to retrieve and store information. However, I still have doubts about how I should permanently plot each location of each user and link the marker button to the user inputted address, phone number. Would I use a loop for this? Please let me know.

---

<div class="post-metadata">

**Author:** ![Shreya\_Santhanagopal](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Shreya\_Santhanagopal](https://community.thunkable.com/u/Shreya_Santhanagopal)\
**Post date:** [April 22, 2019, 5:23pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/8 "2019-04-22T17:23:36Z")

</div>

here is a link to the project as well. The problem I mentioned is in the registering selection screen. In the end, the objective of the app is to get the plot the location of all the registered users and then when another user wants to obtain information of a specific location, the another user should be able to click on the marker plot and it should lead to the information of the specific registered user.

[https://x.thunkable.com/copy/10fd1844da0a9d05af7d76e30fa44228](https://x.thunkable.com/copy/10fd1844da0a9d05af7d76e30fa44228)

---

<div class="post-metadata">

**Author:** ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)\
**Post date:** [April 23, 2019, 9:27pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/9 "2019-04-23T21:27:57Z")

</div>

Shreya,

I think that the problem might be in the `'Map2 call addMarker'` block you are setting the `latitude` and `longitude` as text values. In that block those values need to be numbers. The easiest way to get those as numbers would be to just use the `latitude` and `longitude` output blocks from the `'Location_Sensor1 call GetCurrentLocation'` block.

Hope this helps.

-Mark

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:00pm UTC](https://community.thunkable.com/t/problem-with-for-each-item-in-list-adding-several-markers-to-map-from-a-list/40212/10 "2024-11-08T12:00:48Z")

</div>


