Page 1 of 1

isolating ZIP code from full address

Posted: Sat Dec 14, 2013 5:07 am
by lights_out

So, I have have a service that uses a Google reverse geocoding API but it returns a full address with street number, county, state, country, ZIP code, etc. and I just want it to return a ZIP code. Is there a way to isolate the ZIP code? Thanks!


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 5:18 am
by maxkatz

You can do it only if the service supports it.

On the client side (in your app), you can delete everything but the zip code path in the response. You will still get all the data but in mapping you will only have the zip code available.


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 5:32 am
by lights_out

so, how would I go about "deleting everything but the zip code path"? would I do that in mapping, or from the database, or in the actual service? the API I am using is this url: http://maps.googleapis.com/maps/api/g.... Thank you!


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 5:54 am
by maxkatz

You would do it in service response tab. It's not required as you will still get the entire response. Just map the zip code parameter and don't worry about deleting anything.


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 1:37 pm
by lights_out

OK, I think I understand however when I put a postal code parameter in under address components it always returns as undefined. What should I do?


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 1:41 pm
by lights_out

I know it has something to do with types in the response but I am very confused as to how types work.


isolating ZIP code from full address

Posted: Sat Dec 14, 2013 5:02 pm
by Alena Prykhodko

Do you mean data type? Please read more here http://docs.appery.io/documentation/r...