Default values in forms templates are not sent to the server

It was a good weekend: hands are dirty, head is full of questions.
When we use “Add” form we want to fill in some fields from the page to which we add an item. Normally, we do it by parameters and then paste in default values a template like ${parameters.value}.
When the form is opened, we see those values, but when we try to submit - an error occurs because those values were not sent (they are required). Why? And how to pre-fill in forms?
If we use explicit values like “true” for booleans - they work. But not templates…

Hi @Nikolay,

Using DefaultValue is one of the ways to set a default way. Default value should be send to the server though. I tried the following and it worked as expected.

  1. I set the DefaultValue property of the CategoryName field (assuming the Northwind Categories table).
  2. When I open the Add Category page I can see the default value I have set
  3. When Saving the form I can see the CategoryName being posted to the server in the Netword tab.
  4. The DefaultValue is also reflected in the DataGrid and persisted in the DB.

What could be different in your configuration?

Not in mine - in yours :slight_smile: As I mentioned in my message, explicit values work, but not templates like ${parameters.value}

This is rather strange. Here are the steps I followed:

  1. In the Add event handler of the DataGrid I set a parameter with some value.
  2. Then use ${parameters.categoryName} to set the DefaultValue.
  3. The value is visually set.
  4. When I save the form I can see the value being posted to the server and successfully inserted.

What is different in your case?

Hello
I have problem with Date time default value. Can you help to set default date time for current date ?
Thanks