Skip to main content

Form Prefilling

OSPROV allows you to prefill forms with existing data.

Default Values

Set static default values for fields:

  1. Select a component
  2. Go to the Data tab
  3. Enter a Default Value

Dynamic Default Values

Use JavaScript to set dynamic default values:

  1. Select a component
  2. Go to the API tab (Technical Properties)
  3. 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');