How to Insert a Primary Key (Auto-Incremented) into Multiple Tables from one Page

I am creating a Master Record with many Children (normalizing the database). I am using a MariaDB. All relationships have been created (foreign keys). The master record has a primary key that is auto-incremented.

The form is designed with many accordions. Each accordion component updates a separate table that uses the Primary Key of the Master table. I know that I will need to create a succession of insert statements, one for each table I am updating.

In Wappler, how and where would I grab the Primary Key from the initial insert (after the DB assigns the auto-incremented value) and grab it to be used in the subsequent inserts (into the children tables)?

Community Page
Last updated: