Preview action button on modal

If i have a form within a modal and ive added an extraModalFooterActions, with:
->extraModalFooterActions(fn(Action $action) => [
    $this->previewTermsAction($action),
])
and then
private function previewTermsAction($action)
{
    return $action
        ->label('Preview')
        ->modalHeading('Preview')
        ->form(function ($form) {
            $record = $form->getFormData();
            ray($record);
            return TermsAndCondition::getAcceptForm($record, preview: true);
        })
        ->slideOver();
}
, how should i go about getting whatever data is currently in the form (regardless if fields are disabled or not) so that i can send them to another form? (Initial form is for creating a few parameters and the other one is the client facing form that uses that data). I know Im not going about it correctly as i dont even see the data in $form when its a new record being created and it hasnt been saved yet.
Was this page helpful?