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.

Populate dynamically from custom user meta

  1. Hello

    I want to populate a form field dynamically from a previous form. The existing form field is custom user meta created by the User Registration Add-On.

    I can see the tutorial on dynamic population here
    http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population

    I am unsure of what method to use. If it is shortcode, how do I find the shortcode for the field that GF User Registration created?

    The fields in question are address and phone number that I want to pull from user meta when the user is logged in.

    The form example is here: http://lwwines.com/store/checkout/

    Many thanks

    Posted 13 years ago on Thursday November 10, 2011 | Permalink
  2. If you want to populate fields using data stored in user meta you don't need to write any code. You can use the default value and a special user meta merge tag to insert the value as the default value for that field.

    The merge tag you would use is the {user} merge tag. You would need to know what the meta key/name is for the user meta you want to display. You would then append that to the end like so:

    {user:mykey}

    You would place that merge tag in the default value of the field which can be found under the Advanced tab when editing the field.

    All Merge Tags are documented here:

    http://www.gravityhelp.com/documentation/page/Merge_Tags

    Posted 13 years ago on Thursday November 10, 2011 | Permalink
  3. RonTon
    Member

    Hello Carl,

    If I use any user related merge tags (e.g. {user:display_name}, {user:user_email}...) I get this error message:

    Fatal error: Call to undefined method WP_User::get() in /home/virtualhosts/.../home/httpd/wp-content/plugins/gravityforms/common.php on line 717

    Do you have any idea what the problem can be?

    Thanks,
    Aron

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink
  4. Hi RonTon,

    Sounds like Gravity Forms might not be picking up your version of WordPress correctly. Could you send me a WP login and FTP access to your site via our Contact Us form? Add "ATTN David" to the beginning of your message.

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink