Frappe.ui.dialog with "table" field: Howto populate table from script?

Hi all,

I am trying to set up a dialog with a table like this:


           let dialog = new frappe.ui.Dialog({
				title: 'Table-Test',
				size: "extra-large",
				fields: [
					{
						label: 'Table',
						fieldname: 'table',
						fieldtype: 'Table',
						cannot_add_rows: true,
						in_place_edit: false,
						data: [],
						fields: [
							{ fieldname: 'test', fieldtype: 'Data', in_list_view: 1, label: 'Test' }
						]
					}
				],

			});
			dialog.show();

So far, everything is fine. The table shows as expected an if I remove cannot_add_rows I can add rows.

However, I would like to populate the table via script prior to showing the table.

How would I do that?

Thanks
Dom