Data form template: does not change Default value when selecting a template in a sub-table

* Describe the bug

When selecting a template, rows from the selected record are substituted into the sub-table as a template. The row contains the Currency field (an associative field with the Currency collection) and the Currency Rate field (number), which is filled with the default value (according to the settings) from a similar numeric field of the Currency associative collection.

If the sub-table row was added using a data template, then the default value (Currency Rate) does not change if you select a different Currency value (i.e., the link in the associative field is somehow broken).

If the row in the sub-table is added manually (without a data template), then subsequently, when the Currency value is changed, the Currency Rate value also changes (i.e., the script works successfully).
data-template-subtable-currency-rate-issue-1

Separately, I noticed that if you set additional Linkage Rules for the field to Object (Currency Rate field in the sub-table), which will take the value from the associative Currency collection, then in this case the value substitution is performed successfully. But I have a question: is this how it should be, or will there be some kind of conflict between setting the default value and simultaneously setting the field’s Linkage Rules?
data-template-subtable-currency-rate-issue-2

* Environment

  • NocoBase version: 2.0.0
  • Database type and version: PostgreSQL
  • OS: Windows
  • Deployment Methods: Docker

* How To Reproduce

You can play it on the page
https://a_8hwne7u84ho.v13.demo.nocobase.com/admin/on02hifb4i3/popups/49sblmzszn2/filterbytk/346796233850880/tab/du7brynzz1c

Yes, the default value is only valid for newly added data. Template data is recognized as existing data, so using linked rules to assign values ​​is a good approach.

2 Likes