Json vs Object

Answered

Hi,

I was trying to add an object to one of my tables using AI to test it out. While doing that, it kept adding it as "json", not an object. When asked to explain, AI said this:

Explain field types

You're right to ask for clarity! In Xano, the field type specifically designed for storing structured data like the debt_details you described (with fields like loan_position, interest_rate, etc.) is called json. While you might think of this structure conceptually as an "object" in programming terms, the obj field type in Xano is reserved for system-level authentication features, like those you see in the users or users_2fa table (e.g., for magic_link or totp). Using the json type is the correct way to store your custom structured data within the investments table.

  1. Is it true? should i just be adding json? Any advantage of one over the other? For me, the object seems better because I can then structure the data better when I am saving it. I have about 10 attributes I want to save in this object.

  2. Is it better to add it as an object or another table for the details?

Thanks!

1 reply