What is the best way to create a large number of dynamic hidden fields in ALL gravity forms of a website? [RESOLVED]

I have multiple GravityForm forms (something like 15) on a site I’m now managing.

I want to add to all forms a collection of hidden fields (about a dozen, if not more) with metadata to be sent via post (using the Webhook Add-on) to a 3rd-party system.

Most of these hidden fields - if not all of them, will end being populated dynamically, through the query-string.

So, for example, if a person comes to the site with this URL: https://mysite.com/?lead_src=abc, and I have lead_src mapped to a field in the form, it will properly populate and be sent as “abc” to the 3rd-party system.

If I were to create these fields manually, form by form, I would have to create about 300 fields (12 x 15). And if my set of fields were to change in the future, I would have to edit each form to include the new ones.

With that in mind, is there a better, more streamlined way to add (and maintain) them? Maybe programmatically? I’m guessing a filter, that would add multiple hidden fields to any GravityForm forms (even if more than one form in the same page). Again, the set of hidden fields will be the same for all forms so, if the set of fields change in the future, they would change for all forms.

Jet sloth bulk add fields

The plugin above can bulk add fields on one form to multiple forms without you needing to recreate any fields manually on all forms.

For bulk editing they also offer a Bulk actions plugin.

I would use this filter, so you could also modify them all at the same time. Another similar thread:

A help doc:

1 Like

Thanks Dere,

For this project I ended using the built-in gravity forms filters (gform_admin_pre_render, gform_pre_render, etc), but I will keep the plugin in mind for the future.

1 Like
© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.