Pass recordId to a page after form submission

I have a page with a form block, which creates and entry in airtable on submission. Les call this type of entry “Person” in “People” table.

I want to be able to add an action which open a new page with another form block with the new record “recordId” passed as a parameter, so I can link the data of the second form to the first one as a hidden value. This way, this new entry of type “Car” will be linked to the previously created “Person” entry.

How can I do that?

Here one might need a bit of custom code to do…

based on this

window.addEventListener('submit-form-success-form1', (e) => {
	// e.detail is an object with form field names and values
	console.log('form submit success', e.detail);
	// form submit success { 
	//                   payload: { "Full Name": "Softr" ... },
	//                   response: { headers: {...}, data: {...}, status: 200 }
	//                 }
});

Thank you for you answer @artur.

I am not quite sure how and where I should use the code you have provided.

I want to be able to have in the page it opens as an URL_PARAM or any other technique the recordId of the “Person” record is has been created in Airtable when the first page form is submitted.

Reopening this old thread.
@admin-apk did you ever manage to find a solution to this?
@artur here is what I have tried as per your suggestion, but I cannot find anything in the response hierarchy containing the recordId of the created record when inspecting in Chrome Developer Console … am I looking for something which isn’t returned in the response, or am I doing something wrong?

<script>
window.addEventListener('block-loaded-statement-of-work-new', () => { 
    window.addEventListener('submit-form-success-statement-of-work-new', (e) => {
        console.log(e);
        const response = e.detail.response || {};
        const data = response.data;
        if (data) {
        	var theUrl = '/**PAGE2URL**?recordId' + data.recordId ;
        	alert(theUrl) ;
            window.location.href = theUrl ;
        }   	
    });
});
</script>