Back to All

Is it possible to put default values to the lookup fields that use indexed items?

(edited)

A customer requested a feature where they could reuse the filled form to make a second order with mostly similar values.

Is it possible to define a default value to the lookup fields that search indexed items / options?

The example element below:

+formElement[{
		type: 'itemSelect',
		width: "col-md-3",
		name: 'faculty',
		label: t('form.vmorder.faculty_label'),
		required: 'true',
		lookup: {
			type: "item",
			workspace: "lookup",
			query: "filter=tag:laiterekisteri&term={searchstring}",
			sort: "name,asc",
			result: {
				value: "{item.key}",
				label: "{item.name}, {item.key}"
			}
		}
	}