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.

Routing based on field value

  1. Stylmark
    Member

    I know it's possible to configure routing based on the values of a select field, but is it possible to use the value of that selected option as the recipient rather than having to specify each option individually? For example, I have a drop down menu with 215 options in it and each one could potentially go to a unique address. I'd like to avoid having to enter them both in the select field via Bulk Add AND in the Routing recipient area.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  2. If you wanted to send the email to the value of the drop down menu then you wouldn't use routing. You would use the merge code values instead using the insert form field drop down to get the merge code for that field.

    - Configure your drop down so that values are enabled
    - Populate the values of the drop down options with the email addresses for each option

    See this screenshot: http://grab.by/a5nO

    - Edit your Notification
    - In the Message use the "Insert Form Field" drop down to get the merge code for the drop down by selecting it from the drop down: http://grab.by/a5nT
    - Copy and paste the merge code inserted by the drop down into the Send To email address. Example: http://grab.by/a5nW
    Now modify the merge code so that it gets the value and not the label by adding :value to the merge code. Example: http://grab.by/a5nZ

    Now when the Admin Notification is sent it will go to the value of the drop down field you inserted into the Send To address.

    This is only going to work with the Admin Notification because the User Notification sends to an Email field only.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  3. Stylmark
    Member

    Perfect, thanks!

    Just as a side note, those items would be awesome to have right in the form editor admin itself to save time. Especially in the Bulk Add popup to note that you can include values if you separate the list with a pipe.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  4. Stylmark
    Member

    I've noticed another potential issue with the drop downs. When I have multiple options with the same value but different labels, it automatically selects the first option in the select list that has that value rather than the actual index of the selected option. This is an issue in my particular usage since the drop down list is 200+ countries with each one having an email address that isn't necessarily unique to that country. Several use the same generic contact@ where as some use a specific entry like firstname.lastname@.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  5. I'm not entirely sure I understand what you are referring to. If you output the the merge code with the :value parameter appended on it that will output the value of the drop down value selected. Duplicates won't matter because only one drop down item is selected and it's value is then stored.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  6. Stylmark
    Member

    Here's an example:

    http://pastebin.com/NAjHaCJJ

    In that example if I were to pick United States from the drop down menu and then submit the form the resulting submission actually lists France as the submitted country because it's the first option with the matching value rather rather than United States.

    Posted 12 years ago on Monday May 9, 2011 | Permalink
  7. sboisvert@bryxal.ca
    Member

    I just want to add to Stylmark's comment, regarding pipe delimited values in the bulk add. I had to search the forums to find that after doing a few strange work arounds thinking it was impossible. It would of been really nice to have that as a info bubble inside the plugin. If you would consider adding that.
    If there is one thing I find with Gravity forms its that it does everything I need it to do, I just never know how to get it do it.

    Posted 12 years ago on Tuesday May 17, 2011 | Permalink