How to get all data from a reapeter on click in JSON formate

I have a repeater named “cartList” and here I want to achieve a function that

With on click of a button outside the box, I should get complete data of that “cartList” repeater.

And if that data can be in JSON, then it will be better.

Easy, just retrieve the data from the repeater and stringify it:

const cartListData = $w("#repeater").data

const cartlistJSON = JSON.stringify(cartListData)

Hi Bruno Prado, Thank you so much for the guidance.