Script - default value

how to setup default form field value from the script?


yes, either setValue() or normally just doo.model.fieldName.value = something
It depends on the data type - setValue is mainly for lines or other object types…
doo.model - Tabidoo Help Center.

With Regards,


Default value means a pre-designed value which can be changed, but value setting by your example cannot be changed by user in the form.
I need to setup field Type to some value depending on condition and user can override
this value in the form.


if you write the values in the On model load section (Scripting), you will achieve your desired result.

I don’t know where I’m wrong but if I use the following script
const defval = 0
the user cannot override the value 0 in the form.

I used your script in On model load
When I load the form I see 0
And I can change the value of the field

and how to do it if I am not able to set const defval = 0 in On model load but in On model change?

That’s the right way to behave. In On model change, setValue and value are used in response to some condition. As in the example.

if ((doo.model.DUZP.value && doo.model.DUZP.currentlyChanged) || (doo.model.splatnostDnu.value && doo.model.splatnostDnu.currentlyChanged)) {

if you use the doo.model.fieldName.setValue = 10; you will never be able to override it.

Philip thanks for the answer, but I don’t know how to write this simple example so that the user can rewrite the result xC after entering the values of xA and xB?
doo.model.xC.value = doo.model.xA.value +doo.model.xB.value


could you email us at Where can we sort this out? Thank you, Filip