Trying to update an array

Options
What I'm trying to do is update the referrals object in the user_1 record when a new user sign up with his referral link. So I increment the count variable and normally push the new user name to the referrals.list existing array. count is well updated, but for list I tried all the ways I can(push, merge, ...) and it didn't work. I finally created an array variable(to test) and assigned it to list but that didn't work either.
Please help solve this, thanks.
[Image][Image]Run & Debug
[Image]

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options
    It looks like your "referrals.list" subfield might be a list that can hold 0 elements - so it takes the first 0 elements from referrals, which is perhaps not that interesting. Can you check that type on your database?

    If you don't crack it, you could bring to office hours, which the Xano folks  hold gratis at 9p ET (1a GMT) this evening.

    Finally, I do 1-1 mentoring - glad to look at it on a live (though not gratis) session as well.
  • Leo Med
    Leo Med Member
    Options
    Hey . Yes, I set the list minimum items count to 0.
  • Leo Med
    Leo Med Member
    Options
    Finally got this done by updating the referrals field with a whole JSON instead of going through each attribute.