Need help reading an XML from Google Autocomplete API

Hello,

I can't figure out how to read the XML from Google Autocomplete API. I want to pull all 5 predictions and place them in a list. I think I can't read it because prediction is used multiple times and I do not know how to select the correct one to read from to get the description from.

My blocks

The way I have been reading the XML works perfectly for Google Geocode API

Example XML From Google with Address Edited and the last 3 prediction sections are not expanded.

<AutocompletionResponse>
<status>OK</status>
<prediction>
<description>30 Street, place, MD, USA</description>
<type>street_address</type>
<type>geocode</type>
<reference>ChIJ4aldsiePyokRfmnm1PI000</reference>
<term>
<value>30</value>
<offset>0</offset>
</term>
<term>
<value>Arch Street</value>
<offset>3</offset>
</term>
<term>
<value>Place</value>
<offset>16</offset>
</term>
<term>
<value>MD</value>
<offset>28</offset>
</term>
<term>
<value>USA</value>
<offset>32</offset>
</term>
<matched_substring>
<offset>0</offset>
<length>2</length>
</matched_substring>
<matched_substring>
<offset>3</offset>
<length>1</length>
</matched_substring>
<place_id>ChIJ4aldsiePyokRfmnm1PI000</place_id>
<structured_formatting>
<description>30  Street</description>
<subdescription>Place, MD, USA</subdescription>
<description_matched_substring>
<offset>0</offset>
<length>2</length>
</description_matched_substring>
<description_matched_substring>
<offset>3</offset>
<length>1</length>
</description_matched_substring>
</structured_formatting>
</prediction>
<prediction>
<description>30 Fake Street East, Toronto, ON, Canada</description>
<type>premise</type>
<type>geocode</type>
<reference>ChIJZ7QZUzLL1IkRtdiH9vz000</reference>
<term>
<value>30</value>
<offset>0</offset>
</term>
<term>
<value>Fake Street East</value>
<offset>3</offset>
</term>
<term>
<value>Toronto</value>
<offset>25</offset>
</term>
<term>
<value>ON</value>
<offset>34</offset>
</term>
<term>
<value>Canada</value>
<offset>38</offset>
</term>
<matched_substring>
<offset>0</offset>
<length>2</length>
</matched_substring>
<matched_substring>
<offset>3</offset>
<length>1</length>
</matched_substring>
<place_id>ChIJZ7QZUzLL1IkRtdiH9v000</place_id>
<structured_formatting>
<description>30 Fake Street East</description>
<subdescription>Toronto, ON, Canada</subdescription>
<description_matched_substring>
<offset>0</offset>
<length>2</length>
</description_matched_substring>
<description_matched_substring>
<offset>3</offset>
<length>1</length>
</description_matched_substring>
</structured_formatting>
</prediction>
<prediction>
...
</prediction>
<prediction>
...
</prediction>
<prediction>
...
</prediction>
</AutocompletionResponse>

Check out the XML blocks in the web component, and dictionary blocks

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.