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
ImportPerson columns:
PersonID
LastName
FirstName
Adresse
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?
All the column of the table are with reset on edit OFF
Please post screenshots of the configuration screens of the affected columns.
here are the screen shot
First action to do on all row
action on one row
for the present time i just update 2 mandatory fields
when it wil work good i will add some other fielsd but not all
the table to update
this is one sample of field that is updated to empty
the reset on edit is OFF on all my fields
Oh! I see! I didn’t digest this entire statement:
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.
Ugh! Sorry this didn’t register earlier!
OK i understand now
i will split my treatment in 2 parts with the insert and after the update using
set the value of some columns
sorry thanks
To AppSheet team : it is not a bug
What is the difference between overwriting, and updating, so far as appsheet is concerned
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.
Are your doing this through a workflow?
yes
User | Count |
---|---|
44 | |
29 | |
23 | |
20 | |
15 |