I am converting a non-WordPress 4-company multi-site sharing a database to a WordPress multisite. I would like to find out if Gravity Forms can return a page or pages based on form input rather than submitting content to an email.
Specifically, when a zip code is entered in a form field, can GF be set up to return a “yes, you are within our area of service” page, a “no, but these other companies of ours can help you” page, or “no, you are not within our service area” page.
I have set up the Zip codes in each sub-site as a custom field using ACF. I can provide more detail or happy to hire someone if Gravity Forms can be utilized this way. Is there a way to provide a URL without it going on public display?
You can. You will need 3 different confirmations. Conditional logic can be set on each confirmation. The conditional logic will be set per zip code. So if 11111 = show ‘dealer nearby’, 22222 = show ‘we can serve you’, if not 2222 or 11111 = show ‘none available’. So you will be setting a lot of conditional logic rules, but you can make it work without ANY code.
I believe Conditional Logic with Gravity Forms uses the browser to compute the response, which may be slow for some users. So if you have a lot of eligible zip codes (>100 zips), you may want to hire a dev. Or if entering in the conditional logic rules yourself gets combersome, you may want a dev. With code you can also add more functionality such as Google Maps API.
The single line input field is telling me to use a field that supports conditional logic. I’m looking to allow the user to input their zip code to see if any of our companies serve their location.
I’ve used conditional logic with radio fields, but just to show the field or not. Is there documentation that shows how to return a page with one or two possible company results? The documentation is so extensive I don’t know where to start. I could not find a search result for “return page.”
I don’t need any functionality like Google Maps because I’m not trying to show a location, just to tell someone if we service their zip code. The returned page would show one or two company names.
Short answer: You use conditional logic to display/hide fields based on answers from other fields.
Long Answer (how I achieved a store locator without any code)
I have 6 locations, all in one state. A few locations are within 15 miles of eachother. I wanted to only display the location(s) within 25 miles radius of user’s zip code. I believe this challenge statement is similar enough to yours that the below should work.
I identified all the zip codes within 25 miles of the ‘store’ location zip.
I used excel to create a column per site (6 for me). Site being the header and all of it’s potential zip codes below.
In another sheet, I added all zip codes together. Then I filtered them by unique zip codes. Lastly I copied the unique zip codes for next step.
I return to my sheet with locations and create a new column at the beginning of my sheet. I paste all the zip codes from last step and title the column; I chose ALL ZIPS. Then sort the newly created column by smallest to largest. At this time your sheet should look like this - NA means no zip code matches the location compared to the new column (ALL ZIPS)
I then wrote every possible combination of locations there are. Luckily for me only 4 of my locations are close to eachother. So I don’t have many possibilities. If you have like 100 locations and they are near, you will need a developer to make this work well. My sets:
I then used the filters on excel to define what zip codes each set shares uniquely.
So if you are trying to find unique zips for 2,3,4 you would do the following:
location(1) filter to only show #NA
location(2) filter to NOT show #NA
location(3) filter to NOT show #NA
location(4) filter to NOT show #NA
location(5) filter to only show #NA
location(6) filter to only show #NA
I then know all the zip codes that combination 2,3,4 share. I record this information. In my screenshot I used new worksheets, but just a simple list would be as effective. I do this for all possible combinations.
Open Gravity Forms, we are halfway!!!
I create a zip code field. I actually chose standard single line text, but a zip code field will also work here.
Then I create a field using radio buttons for EVERY combinations that has unique zip codes. So in MY case, I had to create 12 different fields. Each one of these fields resides under the same page break.
Then under the advanced settings of each field, I created a conditional rule for each zip code. Each rule looks like this for each possible combination.
- I then create another group that shows a response of all locations, if the zip code doesn’t match. So you will write out every zip code in your list and appy the conditional formating like such:
- Enjoy, you just built a store locator with no code using Gravity Forms. However, if you have a lot of locations you will need to hire a dev. This is not an ideal store locator, but works with just a few locations.
Thank you for posting your solution @user5e6d257a956b5779 !
Carlos, than you SO much for the detailed response. I’ve just spent 24 hours launching the multi-site and haven’t had time to look this over. I will review later today or tomorrow.
Hi Carlos and Chris,
I agree, I think this solution could work. I have 4 companies, each serving between 20 and 40 zip codes, a total of 116 zip codes and the combinations 2, 3, 4, 5, 23, 25, 34, 35, no24, no45, no triples, none served by 4.
Being new to Gravity Forms, however, I cannot follow the rest of the logic. For example, what you mean by “under the same page break.” And do all 12, or in my case 8 (actually fewer), of the radio button fields go on the same page with the single line text?
My project is different in that the form will be unique on each website. So for company 2,
I have three three/four possible responses as well: a) yes you are in my territory (and any other companies serving that zip code are ignored), b) no, but company 3 OR 5 can serve you, c) no, but companies 3 AND 5 can serve you, or 4) no, sorry.
Can one of you help me complete this? Willing to pay. What is the best way of taking this discussion off this site?
I use a multipage form with one field per page. I assumed everyone had long forms and used pagination If you don’t use pagination, ignore the instruction “under the same page break”.
I am having success using Codeable.io. Gravity Forms also recommends Codeable.io. You can post detailed requirements there and expect a response from a developer who Codeable has vetted. Codeable also acts as the escrow.
Screenshots to explain multipage setup and page breaks:
Hi Carlos and Chris @chrishajer ,
I wanted to give some feedback for anyone else that reads this post, as someone who read it did help me. I never figured out what you meant by putting radio fields under the zip code text input field. My form only needed the one field: zip code; no additional questions. All the logic was done in the confirmation pages with redirects.
We had the yes (if any match) and no (if all are not one of the following ~100 zips) responses, plus 3-5 “alternate company” (if any match) responses for each zip code entered. Example: response pages for company 2, a) yes you are in our territory (and any other companies serving that zip code are ignored), b) no you are not in our territory but company 3 can serve you, OR company 4 can serve you, OR company 5 can serve you, OR companies 3 or 4 can serve you, OR companies 3 or 5 can serve you, or c) no you are not in our service territory.
It would have been a lot slicker if the “alternate company” page could have had a dynamic field populated by the company name(s) rather than 3-5 duplicate pages. Finding the right info and even communicating a task description is difficult until the most accurate terminology is learned. I was hoping Chris @chrishajer from Gravity Forms might have noted a help page with this type of solution, but at the time, I didn’t know the alert would only go to Carlos.
I realize I didn’t say thank you again to you, Carlos, for pointing out this approach.