Header detail page in retool

Hi ,
I have a requirement to create a page with header and detail , where in header contains information like the type_name ,frequency and header_id .Detail contains detail_id ,header_id (to which the detail pertains to), type_rate , type_mode.
So first the header needs to be inserted and then the header_id needs to be inserted in the detail table.