Passing URL Parameters to Pre-fill ERPNext Web Form Fields

When using ERPNext Web Forms for public submissions (e.g., media requests, applications, inquiries), there is a need to pre-fill specific form fields dynamically based on the user’s entry point (e.g., clicking a card for “Foreign Media” vs. “Local Media”). Currently, users must manually select options like media_type, leading to inconsistent data entry and poor UX.

The goal is to allow external links or internal navigation to pass parameters (e.g., ?media_type=foreign%20media) and have the Web Form automatically populate the corresponding field on load — without custom server-side development.

Expected Behavior

  • A link like:
    https://your-site.com/media-request?media_type=foreign%20media
    should auto-fill the media_type field with "foreign media" when the Web Form loads.