[Answered]Wix SDK error: Each item in the items array must..

I am setting the data of a repeater with $w(‘#repeater’).data = repeaterData;

I’m getting Wix code SDK error: Each item in the items array must have a member named _id which contains a unique value identifying the item. "


You can see from the debugger that the array has 3 items, and they each have different _id’s, 0, 1 and 2.

Please tell me what’s going on here.

Hi Mike, the second and third items are arrays themselves instead of objects.
I can see how you missed it, took me a few minutes as well :smiling_face:

Oh, wow, okay thanks Tomer. Let me get stuck into the code and see what craziness I am doing…

1 Like

I am trying to loop through a collection and build the repeater dynamically.

Is repeaterData.push(newRepeaterItem); the usual way to do it?

Hi Mike,

Repeater data is not automatically applied to the elements of repeater items.
You will need to use forEachItem() with the current repeater item index to pull the correct record from the repeater data.

See more information below: