Problem with non-input array parameters

Options

I have two tables. Table 2 has a one-to-many relationship with table 1.

Edit query table 2 has an optional parameter with this connections array.

When I try to update the data in table 2 and don't enter this parameter, I expect the parameter to become null, but the test shows that Xano makes it an empty array.

Main problem: I don't know how to understand when I send an empty array to clear the connection and when I don't send a parameter to keep the connections intact.

Tagged:

Comments

  • Dmitriy
    Dmitriy Member
    Options

    P.S. This only happens if the input is linked to a database. Manually created input does not have this problem

  • Chris Coleman
    Chris Coleman Administrator

    ADMIN

    Options

    Hi, @Dmitriy. Is the field set to allow null values in the database? Database Link inputs will always match what's set in the DB, so if the field doesn't allow for null, the linked input will behave the same.

  • Dmitriy
    Dmitriy Member
    Options

    Hi, @Chris Coleman. I tried both approach. If i set it up non nullable the non-input property will return empty array: [], if i set it up as nullable the non-input property will return a array with one zero value element: [0] (right now i use this to workaround this issue). I think this is because we are setting a nullable property for the values ​​within the collection, but not for the entire collection.