Setting Address Type with API

API Help.

Im using the google geocode api to get the geocode information for an address. Im trying to save this data as part of the geolocation datatype in bubble but i keep getting different errors.

First it was this:

{
    status: 'INVALID_DATA',
    message: 'Invalid data for field Address: could not parse this as a geographic address'
  }

with the payload of this

{
    formattedAddress: '123 Main St, Houston, TX, 77459, USA',
    latitude: XX.5587211,
    longitude: -YY.51798939999999
  }

Then i switched it to a string with the data like this:

`${geocodeData.formattedAddress}, ${geocodeData.latitude}, ${geocodeData.longitude}`

and I got this error:

{
    status: 'INVALID_DATA',
    message: 'Invalid data for field Address: Error hitting Google Geocode'
  }

Theres not much support on this forum for this from what i’ve seen and id appreciate any help on this.

I also have no restrictions on the API as of right now

Weird… that’s all I see. Not all posts get the same attention, though I can agree, some solutions may be harder than others. Sorry to hear that. If you’d like you can join BuildAppolis’ Discord to join others like you that want to build things. It’s not strictly Bubble, but most of the members utilize it.

Make sure your lat and long are wrapped in quotes. I think that may lead to unexpected behavior. To be sure you’re doing this correctly, make sure your data constraints end with :formatted as JSON. This will automatically make sure the data is wrapped in quotes, or of course, you can manually add the quotes but I think the formatted as JSON works quicker.

This topic was automatically closed after 70 days. New replies are no longer allowed.