I’m using an “Add a new row to another table…” action to create or update rows
when the key in ‘table to add’ doesn’t exist the action add a new row with the columns value that are in the list ‘Set these columns’ to insert: this is good
when the key exist the action add a new row make an update with the columns value to update this is good, but the others columns that are not in the list ‘Set these columns’ are set to null(). normally has they are not in the list of column they should not be modified.
Sample:
ImportPerson= table where I’ve got person to import
Person = table with all the person
Person columns:
PersonID = key
LastName
FirstName
Adresse
ResponsibleUser
NextDateToCheck
my Action is Add new row to another from ImportPerson to Person
Set these columns:
PersonID = ImportPerson.PersonID
LastName = ImportPerson.LastName
FirstName = ImportPerson.FirstName
if the ImportPerson.PersonID doesn’t exist in Person I want to add this person in my data base
This is ok the insert is done with the good values
if the ImportPerson.PersonID exist in Person I want to update this person in my data base with the values that are in ImportPerson but not to change ResponsibleUser, NextDateToCheck
The update is done, but ResponsibleUser, NextDateToCheck are set to null !!!
if not a bug how can I do a update on some columns of my table and not on all the column of the table?
Any time a row is updated, all of its columns are subject to their respective App formula or Initial value expressions (initial value only if Reset on edit is enabled). Do the affected columns have expressions for either of these properties?
2 is the key
3 and 4 are the mandatoty fields that are updated
when ID doesn’t exist i’ve got an insert : this is good
when ID exist the update is done on the 2 fields, burt all the others fields of may table are set to empty
this is one sample of field that is updated to empty
I’m using an “Add a new row to another table…” action to create or update rows
Add a new row to another table… strictly inserts; it cannot update an existing row. If you provide a key that already exists in the table, the existing row will be overwritten.
What is the difference between overwriting, and updating
Effectively nothing.
When a column of a row is changed, the entire row–including the changed column–is sent to the server. The server finds the existing row with the same key and overwrites that entire existing row with the entire updated row.
In @Stephane_Liema’s case, they were sending a newly-constructed row with the key of an existing row. The existing row was overwritten with the new one. Existing data was lost because the newly-constructed row was just that: newly-constructed, from scratch, with default values and none of the existing row’s values.
Why the entire row and not just the changed column(s)? Data integrity would be my guess.