A field's default function can be used to set its initial value. The JavaScript is executed server-side when the field's HTML is generated. You can use a default function to execute any JavaScript, including calling End Points and other services.
The function's parameters are:
- helper - The helper library
- defaultValue - The field's default value (usually what's entered into the "Default" property in the forms designer
- currentValue - The current value of the field
In this example the function checks for a currentValue, and if the field already has one, it won't be overwritten by the function.