Sorry this cannot be done by configuration. An idea is use a custom button to trigger an action. Action step execute a script to add new row to list with default value.
import { LIST_ROW_DELETE, MODULE_COMMON } from "./constants";
export class CodeInApplication implements CodeInComp {
execute(context: CodeInContext, fieldsValues: any) {
return new Promise((resolve, reject) => {
const params = context.params;
const common = context.modules[MODULE_COMMON];
const fieldId = params["varId"];
if (!fieldId) {
alert("Please configure input parameter: varId");
resolve(false);
}
const username = context.getFieldValue("field_name"); //variable store the name of current user
let list = fieldsValues[fieldId] || [];
list.push({ "field_1": username});
context.setFieldValue(fieldId, [...list]); //form a new object otherwise the list will not be refreshed.
resolve(true);
});
}
requiredFields(params) {
return [params["varId"]];
}
requiredModules() {
return [];
}
description() {
return "Add row of a list";
}
inputParameters() {
return [{
id: "varId",
type: "string",
desc: "Varaible ID of the list"
}] as InputParameter[];
}
}