Adding elements to a field array in Xano from Weweb

Hi everyone !

I’m currently building a marketplace where people can buy crypto courses.
I linked my website to Xano, and i created multiple databases such as Users, Courses, and also a Shopping cart to store the courses that the user added.

I’m experiencing an issue. My API Endpoint is almost working 100%, but something strange is happening.

When i add a course to the shopping cart, i check on Weweb if it already exists in the field array, if so, an error message is displayed, otherwise, it sends a request to Xano with some inputs shown on this screen below :

I use a course_id to identify the course in my repeating group. The courses_id is an array of course_id located in the shopping_cart database. And each shopping cart is linked to a specific user identified with an user_id. The “Sold” variable helps to distinguish if the shopping cart is in progress or bought (i didn’t finish this functionnality yet).

On Xano side :

I tried to create differents variables to save the course and the list of courses, and then, add the element to the array, and then, update the courses’ list field with the variable value.

Problem is, it always updated the last element of my list instead of adding a new one. And i noticed another problem. When my request is sent, it tells me that i only have 2 items in my courses list while i have currently 3 items. Can’t figure out why.

Thank you if you’ll be able to help me and i wish you all a nice day ! :slight_smile: