PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Send User Date with Form Submission and pre-populate form fields with data

  1. Hello,
    I have a two-fold question. First, for a logged-in user, when a user submits the form, is it possible to have the form automatically submit the user data (email address, name, etc.)?

    Secondly, Is it possible to use this data to pre-populate portions of the form like email address, name, etc? Thanks!

    Posted 10 years ago on Wednesday May 29, 2013 | Permalink
  2. I just wanted to bump my own post. Any answers on this? I was hoping to find a solution I could install and implement by the end of the week. Thanks!

    Posted 10 years ago on Thursday May 30, 2013 | Permalink
  3. David Peralty

    Hi there!

    You would have to have fields for the logged in user data to go, but yes, using merge tags in the default value, you can have this work as expected.

    Where would the data (address) be stored? You can pre-fill anything using our gform_pre_render hook, but you would have to custom code the ability to grab that information and pass it to the fields you want it in.

    Posted 10 years ago on Thursday May 30, 2013 | Permalink
  4. Thanks for the reply! I would be using the Wordpress user data, so I imagine it would be in the wp_users or wp_usermeta table? I'm fairly familiar with PHP, but might need guidance in writing the hook to pre-populate that data. I don't know how much guidance Gravity Forms can provide though.

    Posted 10 years ago on Thursday May 30, 2013 | Permalink
  5. David Peralty

    You'll be using custom meta, so you'll have to manually code it using hooks. Our gform_pre_render hook is what you'll need to pre-populate fields. Our documentation for this hook is pretty good. You'll have to find tutorials on grabbing custom user meta from other sites though. http://www.gravityhelp.com/documentation/page/Gform_pre_render

    Posted 10 years ago on Thursday May 30, 2013 | Permalink