> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formbase.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Passing Submission Data

> Use submitted values on your thank-you page.

Formbase stores every submission, but sometimes you want the values immediately after submit to personalize the next screen. You can do this in two ways:

* Use the existing form data in the browser
* Submit from the server and use the JSON response

<Steps>
  <Step title="Client-side data (fastest)">
    Use the values you already have in the browser and redirect with state or query params.

    ```js theme={null}
    const formData = new FormData(formElement);

    const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', {
      method: 'POST',
      body: formData,
      redirect: 'manual',
    });

    if (response.status === 303 || response.ok) {
      sessionStorage.setItem('lastSubmission', JSON.stringify({
        email: formData.get('email'),
      }));
      window.location.href = '/thanks';
    }
    ```

    On your thank-you page, read `sessionStorage` and render a personalized message.
  </Step>

  <Step title="Server-side data (structured)">
    Submit from your server and return the JSON payload to your client.

    ```ts theme={null}
    const response = await fetch('https://formbase.dev/s/YOUR_FORM_ID', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ email: 'ada@example.com' }),
    });

    const result = await response.json();
    // result.data contains the submitted object
    ```

    This is the best option when you need a reliable JSON response.
  </Step>
</Steps>

<Callout type="note">
  Browser requests receive a redirect instead of JSON. Use a server action or API route if you need the response body.
</Callout>
