AnsweredAssumed Answered

Parse Text Field

Question asked by mmichalak on Sep 25, 2018
Latest reply on Sep 26, 2018 by fmpdude

Hey guys I am truing to extract Latitude and Longitude of an address that was placed in a text field. I need to extract the latitude and longitude and place them in separate text fields. I am not using file maker pro advanced. Im guessing I need a script but I'm lost. The field contains following value:

 

<?xml version="1.0" encoding="UTF-8"?>

<GeocodeResponse>

<status>OK</status>

<result>

  <type>street_address</type>

  <formatted_address>5518 Barclay Ct, Clarendon Hills, IL 60514, USA</formatted_address>

  <address_component>

   <long_name>5518</long_name>

   <short_name>5518</short_name>

   <type>street_number</type>

  </address_component>

  <address_component>

   <long_name>Barclay Court</long_name>

   <short_name>Barclay Ct</short_name>

   <type>route</type>

  </address_component>

  <address_component>

   <long_name>Clarendon Hills</long_name>

   <short_name>Clarendon Hills</short_name>

   <type>locality</type>

   <type>political</type>

  </address_component>

  <address_component>

   <long_name>Downers Grove Township</long_name>

   <short_name>Downers Grove Township</short_name>

   <type>administrative_area_level_3</type>

   <type>political</type>

  </address_component>

  <address_component>

   <long_name>DuPage County</long_name>

   <short_name>Dupage County</short_name>

   <type>administrative_area_level_2</type>

   <type>political</type>

  </address_component>

  <address_component>

   <long_name>Illinois</long_name>

   <short_name>IL</short_name>

   <type>administrative_area_level_1</type>

   <type>political</type>

  </address_component>

  <address_component>

   <long_name>United States</long_name>

   <short_name>US</short_name>

   <type>country</type>

   <type>political</type>

  </address_component>

  <address_component>

   <long_name>60514</long_name>

   <short_name>60514</short_name>

   <type>postal_code</type>

  </address_component>

  <address_component>

   <long_name>3606</long_name>

   <short_name>3606</short_name>

   <type>postal_code_suffix</type>

  </address_component>

  <geometry>

   <location>

    <lat>41.7873670</lat>

    <lng>-87.9524238</lng>

   </location>

   <location_type>ROOFTOP</location_type>

   <viewport>

    <southwest>

     <lat>41.7860180</lat>

     <lng>-87.9537728</lng>

    </southwest>

    <northeast>

     <lat>41.7887160</lat>

     <lng>-87.9510748</lng>

    </northeast>

   </viewport>

  </geometry>

  <place_id>ChIJzX7Z4t1ODogREEusNk5zSio</place_id>

  <plus_code>

   <global_code>86HJQ2PX+W2</global_code>

   <compound_code>Q2PX+W2 Clarendon Hills, Downers Grove Township, IL, United States</compound_code>

  </plus_code>

</result>

</GeocodeResponse>

Outcomes