# Populating a Repeater with 3rd Party Data

**URL:** <https://forum.wixstudio.com/t/populating-a-repeater-with-3rd-party-data/58020>\
**Category:** Ask the community\
**Tags:** api, question, code, wix\
**Created:** [April 11, 2024, 7:23pm UTC](https://forum.wixstudio.com/t/populating-a-repeater-with-3rd-party-data/58020 "2024-04-11T19:23:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![user2007](https://avatars.discourse-cdn.com/v4/letter/u/edb3f5/32.png) [@user2007](https://forum.wixstudio.com/u/user2007)\
**Post date:** [April 11, 2024, 7:23pm UTC](https://forum.wixstudio.com/t/populating-a-repeater-with-3rd-party-data/58020/1 "2024-04-11T19:23:03Z")

</div>

**Question:**  
I’m trying to populate a repeater with data from a .json feed. I have very little coding experience and have watched Wix’s tutorial series about repeaters and coding with Velo. My backend code works fine, but my frontend code isn’t working. When I run the code no information populates my repeater:

 ![Screenshot 2024-04-11 at 2.10.24 PM](https://us1.discourse-cdn.com/wix/original/3X/d/e/de5b500303a3c44612db674d79f42471be7759d3.png)

**Product:**  
Wix Editor dev mode

**What have you already tried:**  
I’ve tried some variations on the code used in the Coding with Velo video series about repeaters, as well as read the Velo Reference pages.

Several of the examples had a string of code at the end like this, and I’m wondering if that’s what I need to add to my code:

$w(‘#eventsRepeater’).data = _ **???** _

But I have no idea what to put where the question marks are. 🙂

Any thoughts would be helpful.  
Thank you!!

---

<div class="post-metadata">

**Author:** ![Rob\_Soto](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Rob\_Soto](https://forum.wixstudio.com/u/Rob_Soto)\
**Post date:** [April 11, 2024, 7:51pm UTC](https://forum.wixstudio.com/t/populating-a-repeater-with-3rd-party-data/58020/2 "2024-04-11T19:51:36Z")

</div>

I think all external data needs to have an ‘\_id’ key to show in the repeater

First you need a reference to your data

```javascript
// i like async to do the load and get the reference
const yourDataArray = await getEvents()

// Im not as familiar with promises but it might look something like this with the 'response' containing the reference to your array
getEvents().then((response) =>  
    
)

// Add this after onItemReady and change your_item_id_key to whatever your id key is
// This is just adding a '_id' key using the id key from your database 
const externalRepeaterData = yourDataArray.map(item => {
       item._id = item.your_item_id_key.toString();
       return item;
});
// Set the new data with _id key to the repeater
$w('#eventsRepeater').data = externalRepeaterData;

```

As long as the data is good and elements are properly named it should work

More info here:

> **[Working with Repeaters - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/getting-started/working-with-repeaters#getting-started_working-with-repeaters_third-party-data)**
>
> Working With Repeaters Let's take a look at one of these more complex elements - the repeater. Actually, a repeater isn't just a single element. It's an ...

Side note I’ve had null images that also prevented the rest of the cell from populating the data so something like this can help if not everything will have an image:

```javascript
const itemPhoto = itemData.image;
if (itemPhoto != null) {
        $item('#eventImage').src = itemPhoto; // itemPhoto is the image url string
}

```
