adding formdata to datastore

I want to do this but no record added.

var obj = contactForm.getFormData();
contactsDataStore.add(obj);

The data is there in obj.

If I use this an empty record is added

contactsDataStore.add();

What am I missing?

Does obj has obj.id set? In such case if it has the same id as one of already existing records - the existing one will be updated, instead of adding new record.

Thank You
That was the problem.
Now I clear id before add and i all works.

var obj = contactForm.getFormData();
obj.id = null;
contacts.add(obj);