Answers/Can I prefill form fields from URL parameters?

Can I prefill form fields from URL parameters?

Updated March 2026

The hosted form at /f/{id} does not support URL parameter prefilling. What you see is what you get.

But with a custom form, this is trivial. Read URL params with JavaScript, set input values. When the user submits, those prefilled values go to Sutrena like any other submission.

Common use case: you send an email campaign with a link like yoursite.com/feedback?campaign=spring2026. Your form reads the campaign param and includes it as a hidden field. Now every submission is tagged with the campaign source.

Another use case: referral tracking. yoursite.com/waitlist?ref=alice. The form reads ref and includes it in the submission.

For hidden fields: add a field with type "hidden" in your form definition. Set its value programmatically in your frontend. The user does not see it, but it gets submitted with everything else.

The pattern is always the same: Sutrena stores whatever JSON you send. How you collect and populate that JSON is up to your frontend.

<!-- Prefill form from URL params -->
<form id="feedback">
  <input name="email" type="email" required />
  <textarea name="message" required></textarea>
  <input name="campaign" type="hidden" />
  <button type="submit">Send</button>
</form>
<script>
const params = new URLSearchParams(window.location.search);
document.querySelector('[name="campaign"]').value = params.get("campaign") || "direct";
document.getElementById("feedback").addEventListener("submit", async (e) => {
  e.preventDefault();
  const data = Object.fromEntries(new FormData(e.target));
  await fetch("https://sutrena.com/api/forms/FORM_ID/submit", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify(data),
  });
});
</script>

Ready to build?

Get a trial API key instantly — no signup required.

Prefill form fields from URL parameters — Sutrena | Sutrena