-
Goal:
I am trying to show a database record in an edit form. I have a query that pulls the entire record from the database and is populating almost all the fields of this form.
The fields that don't show anything are the date fields. if I switch them to text they display the ISO value of the date returned from the query, but that's not what I want. -
Steps:
I have tried changing the format, replacing the default value, checking the form data key, creating a new field from scratch, removing the place holder, removing the time from the source, clearing and resetting the form on modal close, etc. -
Details:
this is a standard datetime field in SQL Server.
and the form field is a standard datetime field as well. -
Screenshots:
Any chance you can share the whole dataForm1Project.data
object? It looks like the CreationDate is a text string in an array?
every value is in an array.
when I break the date value out of the array
it still doesn't show.
I am just curious why only the dates aren't showing, when I have Form Data Key setup.
every other field in the form shows fine, without me having to define default values.
Hi @Shegs, it looks like the component is evaluating the data as a string and not a data object. Let's try setting the default value to:
{{ moment.utc(dataForm1Project.data.CreationDate[0])}}
still nothing:
Interesting! Do you mind sharing the whole object that is the value of dataForm1Project.data
?
Here is my setup:
for some reason, your select statement is putting everything inside a data array, for me, each field is an array.
Try formatting the output under the 'Transform results' setting for the query:
That worked.
And when I switched the form source to the 0 index of that data array, all the fields populated, including the date ones.
Thanks
You are welcome!