I don’t really understand where your data comes from exactly, but check the docs explaining how to insert data in the main and subtable: