How to set a default value for the "updated" column?

Hi.

I noticed that every table automatically has a created and updated columns and that created is automatically populated with the date it was created. Is there a way I can set the updated column to be equal to the created when the record was created instead of having it as null?

Reason I’m asking is that I’m trying to implement a sync approach similar to this. So basically, there will be no physical deletes. Only logical deletes wherein I will have a column deletedFlag to determine whether a record has been deleted or not. Then I will use the updated to determine whether it will be a push or pull on my app.

Regards,
Allen

Hi, Allen. The updated column is a system column in Backendless that cannot be set any value besides automatically assigned. It will have “empty” value when the record is created but did not update. So if you need it to have some value from the very beginning you can update the record right after you’ve created it. You can either do a separate API request for this or set up an eventHandler for “Create” operation, so that every record is automatically updated (just update operation with the same field values) after it is created in a table.

Sounds good. Thanks.