Ternary not executing on null

Hi,

I am trying to populate a default value of an input field with a ternary, but it is executing just upon true.

{{ table1.selectedRow.data.date_1 ? table1.selectedRow.data.date_1 : moment().format('YYYY-MM-DD HH:mm:ss') }}

So when date_1 doesn't have any data, the current time is not added.

Using a date component results in the same.

What I am doing wrong?
Thank you!

Without seeing the data or the table...
Try
{{ table1.selectedRow.data.date_1 != null ? table1.selectedRow.data.date_1 : moment().format('YYYY-MM-DD HH:mm:ss') }}

Hi Scott,

I don't really understand why, but it looks like

{{ table1.selectedRow.data ? table1.selectedRow.data.date_1 : moment().format('YYYY-MM-DD HH:mm:ss') }}

does the trick.

Anyway, thank you for the willingness to help!