3

Is there any configuration option available in Appmaker to Store Today's date as Default in a column record in Appmaker data source?

The current configuration directly provided an option to select date only, no option to write a script which can return me Today's date. Current option for choosing date

1 Answers1

3

Unfortunately, App Maker doesn't provide such setting at this time, but there are at least two ways how you can do it:

  1. If you you are using Custom Cloud SQL instance you can make your table look like this:
CREATE TABLE foo (
    `creation_time`     DATETIME DEFAULT CURRENT_TIMESTAMP,
    `modification_time` DATETIME ON UPDATE CURRENT_TIMESTAMP
)
  1. In case you don't have direct access to the database you can add the following code in onBeforeCreate model event
record.CreatedOn = new Date();
Pavel Shkleinik
  • 6,298
  • 2
  • 24
  • 36