Auto insert foreign key

Hi guys
I have a table 1 with columns employee_id(primary key), employee_name, address. Table 2 has columns ID(primary key), employee_id(foreign key), pettycash_amount, date_received.

In wappler i am creating 2 forms on the same page. First form will be employee and the 2nd form below would be petty cash.

When I fill both the forms and click save button I want the employee_id of table 1 to be inserted automatically in table 2 employee_id column as foreign key.

How can I achieve this?
Hope if steps could be provided as well.
Thanks a lot.

You can do this with 2 insert steps in your server action.
In the second insert step you can get the inserted ID of the first one - it is available in the data picker.