Set relation to User in data table during record creation

I am having some difficulties setting a relationship in the “on record creation” logic of a data table. The data table loads a list of students related to the logged-in User, but when adding a new record, the current User is listed for the ownerId column, but the relation (1:N) in the User table is not set. I’ve followed the Mastering Backendless Database videos on the topic, but can’t figure out what I’m doing wrong here.

Data table:

Logic for setting relationship with User:

Make sure the students column is declared in the Users table.

For the children connector in the Set Object Relations, try changing it to a list containing the Created Object object.

Hope this helps.

Mark

students was defined in Users.

Your suggestion to feed it to children as a list fixed it:

As an added bonus, I learned that the relations block I wanted was “add object relations” rather than “set object relations”. The latter removed the existing relations, but succesfully added the new relation.

All is working now. Thank you, Mark!

1 Like