Default value for timestamp field

Options
First of all, I just want to thank you for your product and service.  Keep doing what you're doing.

Now to my request.  It would be nice to have the option of setting the default for the timestamp field to be "now".  This way whenever the record is touched this field can be used to log the time.  Right now it has to be done through code.

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     - this is already supported. "now" is available in the function stack to always set a timestamp to the current time.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    You can also default this in the schema, just make sure the field is not nullable.

    [CleanShot 2022-01-21 at 15.20.50.png]
  • Ah, thanks.  I didn't know about the nullable "no" thing.
  • Sorry I have to make a follow up to this but I noticed that the field is not updated if I create a new record through code.  This only works when I create a new record in the table view.
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     - can you provide some screenshots? It seems to be working as expected for me
  •  Actually, just tested again and it seems to be fine.  Thanks again.
  • Circling back to this.  Seems like it works when a new record is created.  However it doesn't work if the record is edited.
    [Screen Shot 2022-01-27 at 18.32.50 PM.png]Before editing
    [Screen Shot 2022-01-27 at 18.36.32 PM.png]After[Screen Shot 2022-01-27 at 18.36.09 PM.png]
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
     I think you are assuming that if you edit a field directly in the spreadsheet view that the other field would somehow get updated. This is not the case.

    What you should do is update the record through the API and have your last_updated field take in a "now" timestamp. 

    The spreadsheet view is purely for raw data entry. 
  •  I see.  I have been doing that but thought it might be more automatic if I don't have to always remember to do that.  Thanks.

    Promise I won't add anymore to this thread.  🙂