Using dynamic field population, you can autofill form fields for a user by including values in the URL.
To enable this option within a form, you’ll need to open the form builder and go to Settings » General. Then, check the box labeled Enable dynamic fields population.
Next, you’ll need to assemble a URL with a query string. The query string will use GET parameters to target a specific field and include the value for that field.
All query strings for dynamic field population will follow the same general structure, regardless of field type. As an example, here’s a URL with the basic query string structure you’d need:
http://test.com?wpf20_1_subfield=value
?wpf
: Indicates the start of a query string for WPForms dynamic population.- Form ID: Targets a specific form (in the above URL, the Form ID is 20).
- Field ID: Targets a specific field within the form (in the above URL, the Field ID is 1).
- Subfield Identifier (Optional): Used only when targeting a subfield, such as the City subfield within an Address field (in the above URL, this is simply named “subfield”).
=
(Equals Sign): Indicates the start of the value.- Value: The value you want to add/select for a field. Any spaces should be replaced with
%20
.
Additional Notes:
- For details on how to locate a Form ID or Field ID, please see our tutorial.
- As a general rule, the maximum length for a URL is 2,000 characters.
Next, we’ll take a look at some more specific examples and the query string formats you’ll need for various field types.
Populate Multiple Fields in the Same Form
If you’d like to population more than one field with a single query string, you can include multiple parameters within your query string. For example:
?wpf111_1=text&?wpf111_2=othertext
Populate Fields in Different Forms on the Same Page
If you have more than one form on the same page, you can combine parameters within a single query string. For example:
?wpf111_1=text&?wpf222_1=othertext
Using Conditional Logic with Dynamic Population
Conditional logic will work as normal when using dynamic population. This means that any conditional fields will hide/display based off of any fields that have been auto-filled (conditional logic is applied after fields have been dynamically populated).
Query String Formats for Specific Fields
The table below shares more details and examples on how to set up GET parameters for each field type. If a field has different formatting options, specific examples for those are included as well.
Field Type | Field Format / Variations | GET parameters |
---|---|---|
Single Line Text | – | ?wpf771_1=text%20of%20any%20length |
Paragraph | – | ?wpf771_2=text%20of%20any%20length |
Dropdown | – | ?wpf771_3=Second%20Choice |
Dropdown | Show Values enabled | ?wpf771_4=dropdown1 |
Dropdown | Dynamic Choices: Post Type |
?wpf771_5=123 ( 123 is the Post Type ID) |
Dropdown | Dynamic Choices: Taxonomy |
?wpf771_6=12 ( 12 is the Taxonomy ID) |
Multiple Choice | – | ?wpf771_7=Second%20Choice |
Multiple Choice | Show Values enabled | ?wpf771_8=choice2 |
Multiple Choice | Image choice |
?wpf771_9=Second%20Choice ?wpf771_9=choice2 (Depends on Show Values option) |
Multiple Choice | Dynamic Choices: Post Type |
?wpf771_10=123 ( 123 is the Post Type ID) |
Multiple Choice | Dynamic Choices: Taxonomy |
?wpf771_11=12 ( 12 is the Taxonomy ID) |
Checkboxes | – |
?wpf771_12=Second%20Choice ?wpf771_12[]=Second%20Choice ?wpf771_12[]=Second%20Choice&wpf771_12[]=Third%20Choice
|
Checkboxes | Show Values enabled | ?wpf771_13=checkbox2 |
Checkboxes | Image choice |
?wpf771_14=Second%20Choice ?wpf771_14=checkbox2 ?wpf771_14[]=Second%20Choice&wpf771_14[]=Third%20Choice (Depends on Show Values option) |
Checkboxes | Dynamic Choices: Post Type |
?wpf771_15=123 ?wpf771_15[]=124 ( 123 is the Post Type ID) |
Checkboxes | Dynamic Choices: Taxonomy |
?wpf771_16=12 ?wpf771_16[]=13 ( 12 is the Taxonomy ID) |
Numbers | – | ?wpf771_17=2018 |
Name | Simple |
?wpf771_18=name |
Name | First Last |
?wpf771_18_first=first%20name&wpf771_18_last=last%20name |
Name | First Middle Last |
?wpf771_19_first=first%20name&wpf771_19_last=last%20name&wpf771_19_middle=middle%20name |
– | ?wpf771_20=dude@example.com |
|
Confirmation enabled | ?wpf777_21_secondary=notdude@example.com |
|
GDPR Agreement | – | Not supported. User should manually click the checkbox to agree. |
Website / URL | – | ?wpf771_23=https://google.com Some servers may block requests that include a URL as a parameter. Be sure to test! |
Address | US | ?wpf771_24_address1=Address%20Line%201&wpf771_24_address2=Address%20Line%202&wpf771_24_city=Del%20Mar&wpf771_24_state=CA&wpf771_24_postal=12345 |
Address | International | ?wpf771_25_address1=Address%20Line%201&wpf771_25_address2=Address%20Line%202&wpf771_25_city=Kharkiv&wpf771_25_state=Kharkiv Oblast&wpf771_25_postal=61000&wpf771_25_country=Ukraine |
Password | – | Not supported. User should enter value(s) manually. |
Phone | US/International | ?wpf771_27=5555551234 |
Date / Time | Format: Date, Type: Date Picker | ?wpf771_28_date=11/22/2018 |
Date / Time | Subfield: Date, Type: Date Dropdown | ?wpf771_29_date_m=11&wpf771_29_date_d=22&wpf771_29_date_y=2018 |
Date / Time | Subfield: Time, Format: 12 H | ?wpf771_30_time=6:00am |
Date / Time | Subfield: Time, Format: 12 H | ?wpf771_31_time=13:00 |
Date / Time | Format: date-time
|
?wpf771_32_date=11/22/2018&wpf771_32_time=13:15 ?wpf771_32_date_m=11&wpf771_32_date_d=22&wpf771_32_date_y=2018&wpf771_32_time=6:30am
|
Hidden Field | – | ?wpf771_33=hidden%20value |
HTML | – | Not supported. This field is not user-editable. |
File Upload | – | Not supported. Security measures. |
Page Break | – | Not supported. This field is not user-editable. |
Section Divider | – | Not supported. This field is not user-editable. |
Rating | – |
?wpf771_38=4 Will highlight 4/5 or 4/10, depending on the rating scale is. Will ignore if number is higher than scale, such as 4/3. |
Captcha | – | Not supported. User should manually complete the captcha (Math or Question and Answer). |
Signature | – | Not supported. User should manually sign. |
Likert Scale | – |
?wpf771_41_r2_c1=1 ?wpf771_41r1_c2[]=1&wpf771_41_r3_c1[]=1 r1 indicates first row, c2 indicates second column, etc.Supports single/multi rows rating scale & multiple responses. |
Net Promoter Score | – |
?wpf771_42=4 Will select value 4 from 0 to 10 . |
Single Item | – |
?wpf771_43=10 Supports only “User Defined” Item Type. |
Multiple Items | – |
?wpf771_44=Second%20Item Works the same for both text and image choices formats. |
Dropdown Items | – | ?wpf771_45=Second%20Item |
Credit Card | – | Not supported. User should manually enter credit card data. |
Total | – | Not supported. Value is calculated using JavaScript on page load. |