Form Prefilling
OSPROV allows you to prefill forms with existing data.
Default Values
Set static default values for fields:
- Select a component
- Go to the Data tab
- Enter a Default Value
Dynamic Default Values
Use JavaScript to set dynamic default values:
- Select a component
- Go to the API tab (Technical Properties)
- In the Custom Default Value field, enter JavaScript
Example: Set default date to today:
value = new Date().toISOString().split('T')[0];
Example: Set default time to current time (HH:MM format):
const now = new Date();
value = now.getHours().toString().padStart(2, '0') + ':' +
now.getMinutes().toString().padStart(2, '0');
Example: Generate a random ID:
value = 'ID-' + Math.floor(Math.random() * 10000).toString().padStart(5, '0');