What is Pre-Populate Link?
A Pre-Populate link pre-populates a form with passed in values.
How to Use the Pre-Populate Link
On the "Form->Publish" page, go to the "Pre-Populate Link" section. Copy the URL to edit the pre-defined values to suit your needs.
The general format for the Pre-Populate Link is:
- itemPosition: The position of the item on the form, including the sub-question position in the case of Matrix items. Alternatively, the item's id can also be used, as shown on the "Form->Integrations->API" page, using idX=value.
- YourValue: The URL encoded value with which to populate the given item
You can edit the link to include the items and values you wish to use. For text-based items like Short Answer fields, the value should be the text you want to display. For multiple-choice-based items like Radio Buttons and Checkboxes, the value should be the position of the choice, or choices, you want selected. Please note that all values should be URL encoded to prevent issues with special characters, and each Name-Value pair in the link should be separated with "&", as shown below.
Note: For multi-page forms, only items on the first page of the form can be pre-populated.
Pre-Populate Link Example
Following is an example of the Pre-Populate link for a form with a Short Answer, Radio Button, CheckBox, Drop Down, Radio Button Matrix, and CheckBox Matrix item.
This form could be pre-populated as shown using a link like:
In the above URL,
- "2=YourName" corresponds to the Short Answer Item.
- "3=1" corresponds to the Radio Button Item. "3" is the position of Radio Button Item and "1" is the position of the choice that is to be pre-populated, "Choice A".
- "4=3" corresponds to the Check Box Item. "4" is the position of Check Box Item and "3" is the position option to be pre-populated, "Choice C".
- "5=2" similarly corresponds to the second choice for the DropDown Item, "Choice B".
Next, the Matrix Items also include a reference to the desired sub-question:
- "6-1=2" corresponds to the Radio Button Matrix Item where "6" is the position of the item and "1" is the sub-question number. "6-1=2" prepopulates the second option for the first sub-question.
- "7-2=4" corresponds to the CheckBox Matrix Item where "7" is the position of the item and "2" is the sub-question number. "7-2=4" pre-populates the fourth option for the second sub-question.
Alternatively, the item's id can be used in place of its position,
- "id21=YourName" corresponds to the item whose "id" is "21", and it will be pre-populated with the text "YourName". In this example, this could take the place of "2=YourName" above, assuming the Short Answer's id is "21". You can find the ids for your form items at the "Form->Integrations->API" page. It can be helpful to use the item ids rather than their position since this will not change should you move the items on the form around, etc.
- "id34-1=2" corresponds to the Radio Button Matrix Item, as above. The id for this item happens to be "34", so this pre-population parameter could replace "6-1=2". The sub-question position for matrix items should still be included regardless of which naming format you are using. Similary, you can use item ids for other prepopulate parameters instead of using display position on your form.
As shown in the example below, you can combine these two approaches into a Prepopulate-Link where you can use id for a form item and display position for another.
All items that store results can be pre-populated, except File Upload and Rating/Ranking items.