Support

Account

Home Forums ACF PRO ACF Maps trigger on import? Reply To: ACF Maps trigger on import?

  • I’ve created filters for WPAI in the past to do importing of data, but I have not done anything like this either. You’d need to set up an API key and create a PHP script to connect and get the information you need and then update the field. There is information here https://developers.google.com/maps/documentation/geocoding/intro

    But I think in the end that would fail when you tried to import 7000 addresses. I really think it would time out, or at some point google would refuse to look up any more addresses. The Google Map API has some limits on how many you can look up that are detailed in the doc I linked to above. If you pay for the service the limits are higher, 100K/day and 10/second, but I still think you’re import would end up timing out with the need to connect to google for every record.

    Just looking through the ACF code, the reason that it’s not triggered is that ACF does the lookup using JavaScript when you enter an address and what you need for the import is a PHP function that does the same thing.

    My suggestion would be to have fields in the spreadsheet for the lng and lat values so that you could build a filter for WPAI and do the import without needing to do the lookup on every address during the import. The problem there is that you have 7000 of them and someone is going to have to manually look up all those addresses…. not a job I’d enjoy doing. But it would only be a pita once and then it would just be a matter of adding the new ones.