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.

Dynamic Routing Based on Page Was Submitted on?

  1. markerx
    Member

    Greeting!

    I am trying to create a dynamically routed form... and I am not sure what is the best way to accomplish my desired out come.

    Here's what I am looking for:

    - Create one Gravity Form
    - Use Form created 10 different pages (each a store location).
    - Have form submission routed to store manager.

    I don't want to force web visitor to select/click on anything,

    I want to populate the form based on the page title, or some other method that is based on the page they are visiting at the time of form submission.

    I hope this makes sense.

    Any suggestions?

    Many thanks in advance!

    Posted 14 years ago on Thursday October 7, 2010 | Permalink
  2. - Create a Gravity Form

    - Add the fields you want the user to fill out

    - Add a "Drop Down" field to your form. Edit this field and give it a Field Label of "Store Location" or something similar. Make the options for this drop down each store location, this won't be visible to the end user so make them short names.

    - While editing the "Store Location" select the Advanced tab and set this field to be "Admin Only" under the "Visibility"

    - While on the Advanced tab for "Store Location" also click the "Allow field to be populated dynamically" checkbox and give the field a parameter name of "location".

    - Save Form

    - Go to the Notification setup for this form and turn on and configure the Admin Notification. For the Send To Email choose "Routing" and configure the routing rules by entering the store managers email address and telling it to use that based on what location is selected from the Store Locations drop down you added above.

    - Save Notifications

    Now if you followed the steps above what you can do is when you link to the form you can pass the location via the query string and it will pre-populate the store location drop down... which won't be visible to the end user. Then the email will be routed to that location.

    You pass the value to the form using the parameter name you setup on that field using the querystring, which should be "location". Here is what it would look like:

    Ex.

    http://mydomain.com/myform?location=newyork

    I suggest make the options in the store location drop down one word with no spaces so it's easier to pass via the query string.

    I would also suggest making the first option in the store location field a catch all and setup a routing rule for it in the notifications so that if they get to the form and no location is passed... it will go to someone specific.

    I hope the above instructions make sense...

    Posted 14 years ago on Thursday October 7, 2010 | Permalink
  3. If you aren't linking to the form and are instead embedding the form on each store location page then you would have to go about this differently.

    You would still follow all of the steps above to setup your form... but instead of using a link to pass the data to the form (which would still work) you would pre-populate that field using the shortcode when you display the form.

    On the location page where you call the form via the shortcode you would pass the value of the location using the paramater name you setup for the location field.

    It would look like this:

    [gravityform id=1 field_values='location=newyork']

    Of course change the id in the shortcode to the appropriate form.

    Posted 14 years ago on Thursday October 7, 2010 | Permalink
  4. markerx
    Member

    Carl,

    Thanks for the fast response.

    Under normal circumstances - your solution would work like a charm.

    However, I am "pulling in" the content and the form into each "store" page... using the Headway theme trickery.

    So there is not really a click or URL I can tag with each location.

    I am playing around with using the "Get Custom Field Values v3.2" plugin... and adding a custom field ("Location") with values such as "NewYork" to each store page - and then populate the dynamic field a parameter name using the shortcode ("[custom_field field="Location" this_post="1" limit="1" none="None" between=", " /]").

    So far... no dice!

    Hopefully, I didn't lose you here.

    Any thoughts on using custom field and shortcodes?

    Posted 14 years ago on Thursday October 7, 2010 | Permalink
  5. markerx
    Member

    Carl,

    We must have been typing responses at the same time.

    Your solution:

    [gravityform id=1 field_values='location=newyork']

    IS GENIUS!

    Thanks!

    Posted 14 years ago on Thursday October 7, 2010 | Permalink