You can achieve this with an onChange Catalog Client Script on the numeric field (e.g., No. of Companies Worked).
When the value changes, dynamically build and set the MRVS JSON using g_form.setValue().
Example:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || !newValue || isNaN(newValue)) return;
var rows = [];
for (var i = 0; i < newValue; i++) {
rows.push({
company: "",
position: "",
start_date: "",
end_date: ""
});
}
g_form.setValue("employment_details", JSON.stringify(rows));
}
-
employment_detailsis the internal name of your MRVS. -
This creates the specified number of blank rows automatically when the user enters a number.
