Table of Contents
Overview
In this article you’ll learn how to create a special form where users can save default field values which other forms can use to pre-populate their fields.
Requirements
Please make sure you have installed these plugins/add-ons before following this article:
- Gravity Forms plugin with Elite License ($259/year)
- Gravity Forms User Registration Add-on (Free if you have Gravity Forms Elite License)
Creating a “Default Settings” Form
Go ahead and create new form Forms => New Form.
Now we have to add fields we want users to be able to save as their default values.
As an example I have added 3 fields:
- My Music Taste
- My Movie Taste
- My Hobbies
Make sure to click Update after you finish adding your fields.
Now we have to make these field values permanent. To do that, in Gravity Forms Editor navigate to Settings tab and click on User Registration.
These User Registration Feeds serve to save values entered by the user which we will later use to auto-fill some fields in other forms. To add a new feed, click on Add New button.
In the Feed Settings editor give your feed some meaningful name and click on the Update User button.
User Settings
If you want to update a user’s data through this form, you can use these fields. Otherwise just skip them. We will skip them in this article since we are only using custom fields.
User Meta
To make our 3 fields permanent values we will assign those fields as User Meta values. First select one of your fields in the Select a Field drop-down. Then select the Add Custom Meta in the Select Meta Key drop-down.
Now give your meta key a name that is related to the field, for example “hobbies” (I advise you always use lower caps letters only, and an underscore ( _ ) if you want to use more than one word when assigning meta key names eg. “my_hobbies”).
Repeat this for all your fields
Additional Options
Leave Update Condition unchecked.
When you are done with the steps above, click on the Update Settings button. Now you can close this form.
Pre-filled fields
I have created another Form whose fields should be pre-filled with the Default Settings form’s fields we created above.
To make those fields pre-filled by the values we enter in our Default Settings form, we have to give them a Default Value attribute.
To do this click on one of your fields and click on Advanced tab. Under Default Value you should use this code: {user:YOUR_META_KEY} and replace YOUR_META_KEY with your meta key.
In this case, because I set My Hobbies meta key as hobbies, I’ll have to enter {user:hobbies}
Repeat this for all other fields.
When you are done, click on Update button. And now fields on this form will be pre-filled.
Result
Default Settings Form Page
Create a new page and add the Default Form we created in the first step. Open it and enter something in the fields.
Click Submit and your values should be saved and will be pre-filled in the fields you specified.
Regular Form Page
Open your regular form page—the one we edited in step 2. And now the fields where you added your {user:META_KEY} merge tags as the Default Value will be pre-filled!
If it’s not working please make sure you are using the same meta key name in the User Registration Settings of your Default Values form and in your Regular form fields as the Default Values {user:meta_key}.
If it’s still not working, repeat all the steps above and make sure you did everything correctly. Or, leave a comment below and we’ll help. 🙂
Video walkthrough
Conclusion
With this feature, your users and members will no longer have to waste time on entering values each time they want to submit a form.
For example if you have a checkout form with some custom fields that a user fills with the same values each time they make a purchase, it will be pre-filled with the values they save in the Default Values form. Or, if you run a service where your customers log into a backend and submit orders or various details to you, this approach can improve the user experience for your customers.
Finally, if you’d like our team to set this up for you (and save yourself the cost of GravityForms) take a look at our MemberFix service and get us to do it for you!
Thanks for posting these instructions. I was stuck trying to figure out how to pass the form fields, and this really helped. I’ve been able to pass 2 of the 3 fields I need, but I can’t get the email field to work. At first I thought it might be because of the way WordPress uses the email field as part of it’s login, but I’ve successfully used username as a meta key. I’ve tried several different names for it in the meta key: email, user_email, and email_address, but none of them work. Do you have any ideas for me?… Read more »
Hi Lisa,
Hmm…I’d really have to get into your site to see what the issue might be.
Hi, thank you for this information ! It has been really helpful, however now I am trying to accomplish the same thing but with checkbox fields. I would like them to be saved and then pre-filled the next time our users go back to the form except I’m not sure how to go about this since there is no default value option in the advanced tab of a checkbox field. Would you know a way to achieve this using user registration ?
Thank you !
Hi Megan, great question!
Here’s a tutorial I found on how to allow prepopulation of checkbox fields:
https://resoundingechoes.net/development/pre-populating-checkboxes-gravity-forms/
V
Hi, these instructions are great, I wondered if I already have a form users have completed in the past (1 year ago) can i make this the default form and then create a new one.
Will the new one find the information from the old form (completed by the user before i made it the default form),?
Or do you have to make the form default then collect the information for it then to work? i.e past information already held on the entries makes no difference.
Thanks
Hi Helen, You could get the new form to recognize the data from previous submissions, yes. 🙂 But you would need to do one of two things. 1 – If the form that your users completed 1 year ago took their answers and placed them in their user meta fields like we explain in this tutorial, then the new form would be able to pull those answers / preferences into it by checking the logged in user’s meta fields and populating the new form with the values in those fields. 2 – If you didn’t do that, you would have… Read more »
I’m in the same situation as Helen. I have a form that users have filled in for over a year. I want to take certain fields from that form & prefill another form. How do I make the original form the default form? How do I get those fields across to the new? Your guidelines outlined above do not work for my situation?
Hi Jez,
You can create a new form and pre-fill the data you want from the previous as well.
You can do that using the meta_key as we described in this tutorial in the section “Pre-filled fields”, but please, make sure that you use the right meta key that you used when you created the default form (like we describe here: https://www.screencast.com/t/RBhtbfknPo).
Let us know if you need more help or you can send us a screenshot of the problem.
We will be happy to help you.
Best regards,
Albin
If you are looking for a high-quality plugin to allow easy syncing of data between separate Gravity forms, make sure to check out our Entries Importing for Gravity Forms Plugin, here: https://plugins.viastudio.c…
We’re a long-time WordPress development shop, and are releasing our plugins to the public, with docs and support. Cheers!
Thanks for the share, Nick! Your plugins look great. 🙂
I’m having the same difficulty that Lisa Cowan did below. I have one field that saved and pre-populated, but none of my other fields did. I went through the instructions again and everything looks to be done the same.