Overview
In certain situations, you may want to streamline the user experience by pre-filling form fields with information already collected elsewhere. By appending query string parameters to your campaign URL, you can automatically populate specific fields in your ShortStack form. This guide walks you through the simple setup.
Setting Up Your Form Container and Field Widgets
- In the Campaign Builder, add a Form Container to your campaign.
- Add Field Widgets corresponding to the data you wish to collect (e.g., Name, Email, Country).
- Once your form is set up, publish the campaign to generate the Campaign URL.
Constructing Your Campaign URL with Parameters
To pre-fill form fields, you'll need to append query string parameters to your Campaign URL. The format is as follows:
https://yourcampaignurl.com?parameter1=value1¶meter2=value2Steps:
- Determine the field names in your ShortStack form that you wish to pre-fill. It's advisable to use these exact names as parameters to avoid confusion.
- Append each field name and its corresponding value as a query string parameter to your Campaign URL.
Example:
https://yourcampaignurl.com?email=example@example.com&country=USA
Handling Multi-Section Fields
For fields with multiple sections (e.g., First Name and Last Name), separate the values using a pipe character (|).
Example:
https://yourcampaignurl.com?name=John|DoeThis will populate "John" in the First Name field and "Doe" in the Last Name field.
Custom Fields
For any custom fields (Text, Boolean, List, Date, Number), you will need to use the Internal Field Map ID. This is found at the bottom left corner of the Field Widget settings.
For the Text Field above, the Internal Field Map ID is custom_text_59.
Example:
https://yourcampaignurl.com?custom_text_59=instagramNote: If you want to use your own text in the URL, you should use the Advanced Setup Method. Advanced: Autofilling Form Fields Using Query String Parameters
Finish Creating Your Campaign
Once you are finished configuring your parameters, you are done! ShortStack will automatically import data from the URL into the Fields widget, with no Action Widget(s) required.