Hello fmsoup community! I’ve mostly been out of FileMaker development for years, but I still like to tinker with it on occasion. Recently I’ve been using the radar.com API in Appsmith for address auto-complete and geocoding, and I wanted to see if I could build the same thing in FileMaker.
Here’s a simple demo app that shows how to use the free radar.com API to create an address auto-complete. Just paste in your API token and start typing an address to see matching results. Radar Address Auto-Complete.fmp12 (528 KB)
It will autocomplete matching results based on the user's location, or you can optionally specify a different center for the search.
The radar.com API is easy to use and has a generous free plan. I don’t have any affiliation with them, I just found their API recently and thought it was a lot easier to integrate than Google Maps.
Additionally, this demo shows how to:
request an array of records from an API and save the response to a global variable (to be accessed outside the script, later)
keep calling that API as the user is typing, and pass the user's text as a URL param
Parse a JSON array without looping scripts (JSONGetElement() in a calc field)
Relate each record in the response to a record in FileMaker (cartesian join)
Display the JSON in a portal (select a result from the auto complete addresses)
This was fun! I kind of miss FileMaker. How ya'll doing?
Thanks for sharing this, @greenflux , it's fun to play with. I'm located in Bangkok, Thailand and sadly it's not really usable as intended. However, entering part of my U.S. address it finds it immediately and precisely, with surprisingly few characters entered.
Addresses in Thailand can be a bit tricky, but I even entered a precise address on a main business district road and it could not resolve anything remotely useful. Radar sees locations here, but doesn't resolve working addresses, at least in my few attempts. Having lived in Bahrain for nearly three years, I can guess it would be even worse there due to the really unconventional (to me) address formats. Google maps doesn't work well there either for many addresses, but does get the main roads and buildings pretty well.
It seems likely that Radar would be best suited where addresses are formatted in a consistent and sort of "normal" manner, and where they have the greatest demand. This is NOT a criticism, just an observation. Again, thank you for sharing it. I'll play with it a bit more and see if different input strategies helps it find its way here in BKK.
Very clever, especially if your address entry is primarily locally. It appears to prioritize responses based on distance from your current location, until it gets enough specificity to create a match in another geography. Works great for the current client application, but I'd need to see if there is a flag to disable the current location flag for other solutions that are nationwide.
Thanks! Yes, the Radar API defaults to your current location, but it also has an option to pass in a different location for the center of the search. They also have a map embed API, so you can let the user pick the search center by selecting a point on the map.
I just wrote a similar script to auto-fill addresses in an Airtable base. Their IDE is actually pretty decent. I hadn't used it before and was impressed with the editor. It has syntax highlighting, auto-complete, IntelliSense tooltips, collapsable code, etc.