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.

How to retrieve custom user registration data back into a form?

  1. Polansky
    Member

    With the registration plugin I made an extra field called 'company name'.

    Now I would like to retrieve this specific field back into a form, after the user has been logged in and fills out an order form.

    How can I retrieve this custom registration field?

    {user:companyname} or (user:user_companyname} or whatever doesn't work.
    I can't find any information about this in the documentation either.

    Is it possible to retrieve such custom made registration fields back into a form to have it predefined as a standard value?

    The customer is already logged in, so its ID is known. All I need to do is retrieve this field back into the form.

    Posted 13 years ago on Tuesday June 28, 2011 | Permalink
  2. The merge tag for outputting user meta is currently undocumented. You are on the right track, however you need to make sure your key is correct and that means case sensitive also.

    This is the merge tag for displaying user meta:

    {user:key}

    So if you create custom user meta using the User Registration Add-On and name the custom field companyname you would return the value in a field by using this in the Default Value for that field:

    {user:companyname}

    I just verified that this works in the latest release of Gravity Forms. I created a brand new form and populated it with that merge tag. I then created a registration form and used the User Registration Add-On to configure a field that creates custom user meta using the key companyname.

    I then submitted the form and created a new user, logged in and browsed the form I created using that merge tag as a default value. It populated the field with my custom user meta value.

    So that merge tag does work, but you must make sure that the key you pass is indeed 100% correct.

    Posted 13 years ago on Tuesday June 28, 2011 | Permalink
  3. Is it possible to be able to watch a tutorial of this process?

    Posted 13 years ago on Thursday July 21, 2011 | Permalink
  4. We don't have a video tutorial for this.

    Here is a screenshot of a text field configured to set the default value equal to a custom user meta field with the key name company: http://i.imgur.com/EBoAK.png

    With the field configured like that the default value would be populated with the value of a custom user meta field with the name company. This is just an example, of you don't have a custom user meta using company as it's name it obviously wouldn't work.

    Posted 13 years ago on Thursday July 21, 2011 | Permalink
  5. Ok, thanks for the screen shot, I will try this out!

    Posted 13 years ago on Thursday July 21, 2011 | Permalink
  6. Hi Carl, I also have been looking into this and I am wondering whether it is possible to use this with a field that has radio buttons too?
    I want to add User Type and the visitor can choose from 6 different options (only 1 possible choice), but looking at the screenshot you gave earlier, that is only for a single text field and not for a radio button field...
    Appreciate your help on this!

    Got it all working! Great that it also works on fields with radio buttons! This is a brilliant addon!

    Posted 13 years ago on Monday September 12, 2011 | Permalink

This topic has been resolved and has been closed to new replies.