Dynamically Updating Gravity Forms Fields

We use two form systems here at John Carroll, Wufoo and Gravity Forms. Something we do often in Wufoo is pre-populate form fields using URL strings.

I recently found myself needing to do that in Gravity Forms and realized that while it takes a few more steps than Wufoo, which you can do via the form’s URL, you need to do some edits in your form first.

When updating your form, find the field you’d like to be able to update via the URL string, and select the advanced tab of that field. Find the checkbox that says to allow that field to be populated dynamically. Check it and then give that field a name. This is how you’ll send it a value via the URL.

Screenshot 2014-07-09 11.55.25

Now, in your URL, you can call https://www.highedwebtech.com/pathto/form?areastosupport=value and that field will contain your value. This works for checkboxes, radio buttons and freeform text fields. If you have conditional logic, passing the variable will make sure any logic questions are processed. I have tried this in practice and it works really well. I didn’t seem to notice the order of the variables in the URL affecting the logic, but YMMV.

For checkboxes, you can put values in commas, so areastosupport=1,2 will check two boxes. For longer strings, seperate your text with + (plus signs.) That would look like areastosupport=This+is+my+string.

You can pass as many variables as you want, including admin and hidden fields, as long as you set them up ahead of time. You would add an ampersand between fields, such as https://www.highedwebtech.com/pathto/form?areastosupport=value&namefield=Name&emailcode=TRD&greeting=Hello+From+Mike.

3 thoughts on “Dynamically Updating Gravity Forms Fields”

  1. Hi,

    I have a dude, if the form is the same page how to prepouplate??

    I insert the form with shortcode

  2. Thanks Mike. Saved us time.
    BTW – Do you recall where you found documentation on using the comma to separate multiple checkbox values in a query string?
    Thanks again.

Comments are closed.