Background:
Our organization can only have a specific number of clients in a geographic region. We have a Google spreadsheet that shows all of the major metropolitan areas in the United States, as well as the number of openings that are available in each area.
What we want to accomplish within Gravity forms:
A client selects their chosen metropolitan area from a drop down list inside a form.
The form updates in real time from the data found on a Google Sheet and populates the available cities.
The city’s availability number update after a purchase is made by the client. The Google Sheet will be updated with this change. This update doesn’t have to be accomplished by Gravity Forms. I am just adding this so you know that the Google Sheet will change in real time.
The Gravity Form can see in real time that this city is no longer available based on the availability now being zero and excludes this city from the list.
In the future as a client stops ordering and “inventory” is available again, we update the Google Sheet to reflect this new availability and the city will appear dynamically in the form again.
In other words:
How do I use Gravity Forms to pull dynamically changing information from a (Google) spreadsheet?
If not through Gravity Forms, any suggestions on how we can accomplish this? (We have G Suite, Elite Gravity Forms and Zapier as our main tools.)
Hi Sam. It sounds like at a very basic level, you need to pull information from a Google Sheet into your form field or field. To populate a drop down, you can use this method:
The issue is going to be getting that information from Google Sheets. I have not found a plugin that can do that yet after searching for a while. You may have to code that part yourself. Instead of the get_posts call in the example I posted, you would use your own code to connect to the Google Sheets API and query that data you need. Here is some information on getting started reading information from Google Sheets via the API:
That would take care of the initial part, populating your form with availability from the Google Sheet. I think you could use Zapier to update that sheet after the form is submitted, so the next time someone loads the form, the availability has been updated. They have a zap " Update Google Sheets rows with new Gravity Forms submissions" here:
Please let me know if that is along the lines of what you’re trying to do. I’ll leave this open in case anyone else can help with additional suggestions or experience. Thank you.
Thank you Luis. I noticed you had another topic. I was not sure if it was a question or a solution, so I answered with some suggestions. But it sounds like you have accomplished something already? Can you share that with us here please?