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.

Global variables

  1. chucktho
    Member

    In another post, "Not all global variables are available. Those {name:parameter} tags are specific to Gravity Forms and only parse if we have written the code to parse them. So it won't work with all variables but we try to include a large number of them." was mentioned. Is there a list somewhere of the variables? I've searched and can't find it.

    I'm trying to pre-populate fields in a form. {user:user_email} produces the desired result, but {user:first_name} doesn't produce anything. Am I doing something wrong? Can you help? Thanks

    Posted 13 years ago on Thursday December 16, 2010 | Permalink
  2. First thing that needs to be done before pre-populating fields is to save the form.

    You can send any amount of data to the forms via header and the form can set the variables as you see fit.

    If you send a bunch of variables through the header and a form set up to dynamically populate the data sent needs to be the same as the form field variable name.

    http://www.mypage.com?first_name=Joe&last_name=blow

    your form fields need to accept
    first_name - First Name Form Field
    last_name - Last Name Form Field

    Sounds pretty obvious, sure. I haven't tested the theory myself as I only have GF for the Paypal (which I haven't upgraded to yet due to conflicting thoughts with the dev team).

    To my understanding of previous replies by the team, this is how it is done. Basically it boils down to "It's easy to do if you define your own variables". The down side is that it doesn't affect the current form being populated..only the one the variables are sent to (though I'm thinking they will implement an ajax approach someday)

    Posted 13 years ago on Friday December 17, 2010 | Permalink
  3. @clucktho Those variables aren't for populating field values. They are variables for displaying field values in places where they are supported (such as Notifications, Confirmation Message, etc.) . There is no list of them because they are unique to your form. They contain the field id, which is unique to each individual form. You have to use the "Insert form field" drop downs to have it generate the correct variable for you.

    How are you trying to pre-populate fields? Are you trying to do it by passing data via the query string? Using PHP? If you provide more details on what you are trying to accomplish I can let you know the best way to go about doing it.

    Posted 13 years ago on Friday December 17, 2010 | Permalink
  4. chucktho
    Member

    Sorry for the delay, either the "subscribe" feature isn't working or it's going into spam. I'll watch more closely.

    I've added fields to wp_usermeta and I would like to populate those fields from the form.

    I'm not a coder, so if what I want to do is possible, please give me step-by-step instructions.

    Thank you, Chuck

    Posted 13 years ago on Saturday January 8, 2011 | Permalink
  5. @chucktho Currently populating a field with data from wp_usermeta would require custom code and using available Gravity Forms hooks. What I am going to do is see what can be done to add the ability to use any user meta using variables. What you want to do requires custom code, so rather than trying to explain code to you i'll see what we can do to make it possible without code. I'll have to get back with you on this.

    Posted 13 years ago on Sunday January 9, 2011 | Permalink
  6. chucktho
    Member

    Thank you for getting back to me so quickly and for helping.

    FYI, the "Subscribe to this Topic Via Email " is not working for me. I've checked my spam folder and its not there either.

    Posted 13 years ago on Monday January 10, 2011 | Permalink
  7. Yes, we are aware. The plugin we use for that is not the most reliable. We will either be rewriting it or removing the feature.

    Posted 13 years ago on Monday January 10, 2011 | Permalink

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