logo
Documents & Forms
Microsoft 365 & SharePoint Tools
Classic SharePoint Tools
Forms
Jul 05

Pre-populate Microsoft Forms

Customer Support Engineer

Ever wished you could prefill Microsoft Forms? Until recently, it wasn't possible. But now, Microsoft Forms has introduced a pre-populating function!

Microsoft logo
We are excited to share that Microsoft Forms now supports pre-filled links, making your data collection process more efficient and improving data accuracy.
Junyu Bao from Microsoft in this post about pre-filling Microsoft Forms

In this guide, we’ll explore how to create pre-populated URLs for Microsoft forms and a neat trick that allows you to manipulate the pre-filled data.

In this article:

How to pre-fill fields in MS Forms

To pre-fill a Microsoft form, we need a Microsoft form. Go to this page and click Create a new form:

Create a new form  

For my example, I built a simple PTO request form with a couple of fields:

  • First and last name of the employee
  • Department
  • Start and end date of the requested leave
  • Justification

For a more detailed guide on creating a Microsoft form, check out the corresponding part of this article. Here's the result:

The Microsoft Form we will prepopulate  

That's a lot to type in! Let's make a pre-populated version of the form so the employee can fill it out before reaching retirement age.

Click the ellipsis icon in the top-right corner of the screen and choose Get Pre-filled URL from the menu.

Click the "Get Pre-filled URL" button  

You'll see a special version of the form that allows you to create a link with pre-filled answers. Let's click Enable pre-filled answers and fill in the employee's data so they don't have to type it in every time.

Microsoft form to prepopulate  

Once you're done, click Get Prefilled Link.

Click "Get prefilled link"  

Now you can send out your pre-filled form with this link, and the default access settings will apply.

To change the access settings, click the Collect responses button in the top-right corner of the screen.

Click "Collect responses"  

Here you can specify who can access the form and how. I'll pick the Anyone can respond option to test my link in an Incognito tab.

Change access settings  

There is a caveat to be aware of: if the form is set to something other than Anyone can respond, it will automatically restore answers from a previous session if there are any. In this case, the pre-filled answers won't be applied even in an Incognito window.

The solution is to submit the form and open it again, which is not ideal. To create pre-filled forms that are only accessible to a select group of people, use a third-party tool. Here's an article on how to create pre-filled forms that allow for restrictions.

How to pre-fill MS Forms fields with any data

Creating pre-filled links manually might prove tedious, so making them automatically would be nice. Let's create personalized links for all our employees at once using URL parameters.

This was possible in Microsoft Forms Pro, a different product that was since then renamed to Microsoft Dynamics 365 Customer Voice and later discontinued. Now the simplest option is to use specialized software for creating pre-filled forms using various sources of information.

If you feel like sticking to MS Forms for prepopulating fields, there's a sneaky trick we can use to imitate this functionality.

The pre-filled link you've made in the previous step should look something like this: https://forms.office.com/Pages/ResponsePage.aspx?
id=fH3IRPjZm9vmb&
reb285f26b2f=FIRSTNAME&
rb687f5c=LASTNAME&
r0c2ecff087c4152ad4=EMAIL&
rf6f421250b0=%22R%26D%22

If you analyze this link, you will realize that it has a static part https://forms.office.com/Pages/ResponsePage.aspx, then a question mark and some parameters at the end specifying the dummy answers I pre-filled: FIRSTNAME, LASTNAME, EMAIL, and R&D. The parameters are delimited by an ampersand.

Notice how even though field IDs are illegible, all values are stored as plain text and you can edit them. As long as you keep the static part and the IDs intact, the link will still work.

You can use Power Automate, JavaScript, or even edit the link by hand. I'll make an example in Google Sheets:

Data for pre-filling Microsoft Forms  

Notice how the Department column has special characters in it. Since Department is a dropdown, we need to put %22 at the start and the end of each option. Special signs like space, ?, or & should also be replaced with %20, %3F or %26 respectively. This is why R&D becomes %22R%26D%22.

For a full list of all special character codes, check out this article about URL encoding.

The last column in the table is for the formula. There's nothing fancy there, I just replaced the dummy answers with cell content like so:

=CONCATENATE("https://forms.office.com/Pages/ResponsePage.aspx?id=fH3IRPjZm9vmb&reb285f26b2f="; A2; "&rb687f5c="; B2; "&r0c2ecff087c4152ad4="; C2; "&rf6f421250b0="; D2)

Voila! Each generated link leads to a different pre-filled form.

Automatically generated pre-populated links  

Frequently asked questions

1. How do I set up pre-filled fields in Microsoft Forms?

Use the "Pre-filled links" feature. You can edit the link to change the pre-filled answers, but this feature has some limitations.

2. Can I use URL parameters to pre-fill fields in Microsoft Forms?

This isn't officially supported, but you can create a pre-filled link with MS Forms and edit its URL to change the answers.

To apply conditional logic or pre-fill fields from URL parameters, use a third-party solution like Plumsail Forms. Here's an article on how to do this.

3. Are there any limitations to using pre-filled fields in Microsoft Forms?

Yes, there are several limitations. You can only use URL parameters and there is no way to apply conditional logic to the pre-filled fields or make the pre-filled fields unchangeable.

4. What are the alternatives to MS Forms that allow for pre-filling fields?

Most third-party tools have for pre-filling. For example, Plumsail Forms allows you to pull data from almost any source - URL parameters, user profile, SharePoint list, or previous submissions. Learn more from this article.

5. Who can access the pre-filled version of a form created with Microsoft Forms?

Depends on the access settings of the form. It can be either anyone, people from your organization, or people from a specific group within your organization.

Try Plumsail Forms for pre-filling forms

As you might have noticed, there are some limitations to prefilling fields in Microsoft Forms. For a full pre-populating experience, use a specialized tool like Plumsail Forms. This will allow you to:

  • Use URL parameters
  • Use browser's local storage
  • Pull data from the internet
  • Get user's data from their Microsoft account
  • Make the pre-filled fields unchangeable or hide them

Pre-filled form created with Plumsail Forms  

Check out this article to get a gist of all the possibilities. Once you're done with that, create a free Plumsail account and follow this guide to build your first form.

Happy automation!