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:

Creating a “Default Settings” Form

Go ahead and create new form Forms => New Form.

90823195 - How to save and pre-populate fields in GravityForms

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

90823284 - How to save and pre-populate fields in GravityForms

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.


90823328 - How to save and pre-populate fields in GravityForms

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.

90823405 - How to save and pre-populate fields in GravityForms

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.

90823580 - How to save and pre-populate fields in GravityForms

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”).

 

90823638 - How to save and pre-populate fields in GravityForms
Repeat this for all your fields
90823696 - How to save and pre-populate fields in GravityForms

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.

90823900 - How to save and pre-populate fields in GravityForms

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}

90823978 - How to save and pre-populate fields in GravityForms

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.

90824142 - How to save and pre-populate fields in GravityFormsClick 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!

90824268 - How to save and pre-populate fields in GravityForms

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!