@louisadekoya, just retrieve those address components from the geographic address and store them in your own fields. The geo address data type has many :operators (or perhaps you might call them subfields) that represent the components of the address. Play around with those in a text element to understand what is available to you (or consult Google geocoding API docs, perhaps).
Basically, when a user enters or updates their geographic address, you can decompose the parts you want and save them on some object, be it the user or your own address data type. In this way, you can avoid making tons of API calls to get :city and :state or :state_code (or whatever it’s called) at runtime. When you reference these operators on a geo address, you are actually consuming Google geocoding API calls, which is not always desirable.
Thanks for the suggestion, @keith. To be clear, what I want is that as a user searches for their address to enter it, the list of matching addresses only includes city and state. As I won’t have a list of all states and cities in my database, I believe I do have to use the Places API, unless I’ve misunderstood your suggestion.
@louisadekoya Did you ever get this to work? I have a survey/quiz and am looking to have the user enter their city as well. I feel like it is too much to ask them for their actual address outright at this stage and capturing only a State would be limiting.
Enable users to input their address either at sign up or to edit on their profile page >
Add a text element to your group >
Insert dynamic data >
Select "Current Page User’s Address >
More >
Extract: >
Then select City >
Repeat from insert dynamic data >
Select state