Newbies Ronji Posted October 6, 2017 Newbies Posted October 6, 2017 Hi Guys Thank you to Richard Carlton for his video on integrating Zippapotamus with Filemaker and the zipcode lookup. In Australia you can have multiple cities for a zipcode and the parsing code is pulling out the first entry and I would like to populated a value list if more than 1 is returned? A scriptParameter is sending this: "place name" &¶& $JSONdata to: Let ( ~startPosition = Position ( $JSONdata ; Quote ( $valueName ) ; 1 ; 1 ) + Length ( $valueName ) + 1 ; Middle ( $JSONdata ; ~startPosition ; Position ( $JSONdata ; "\"" ; ~startPosition ; 1 ) - ~startPosition ) ) Here is the JSON data{"post code": "4220", "country": "Australia", "country abbreviation": "AU", "places": [{"place name": "Burleigh Heads", "longitude": "153.45", "state": "Queensland", "state abbreviation": "QLD", "latitude": "-28.1"}, {"place name": "Burleigh Waters", "longitude": "153.4341", "state": "Queensland", "state abbreviation": "QLD", "latitude": "-28.0895"}, {"place name": "Burleigh Town", "longitude": "153.4341", "state": "Queensland", "state abbreviation": "QLD", "latitude": "-28.0895"}, {"place name": "Miami", "longitude": "153.4341", "state": "Queensland", "state abbreviation": "QLD", "latitude": "-28.0895"}]} Only the first "Place name" is being returned. Thank you in advance. Ron
Newbies Ronji Posted October 8, 2017 Author Newbies Posted October 8, 2017 The answer is firstly get a count of the items ValueCount ( JSONListKeys ( Clients::JSONZIPDATA; "places" ) ) then loop through and create the list set variable[$i ; Value: 0 ] Loop Set variable[ $list & "¶" & JSONGetElement ( Clients::JSONZIPDATA ; "places[" & $i & "].place name") ] end loop
Recommended Posts
This topic is 2869 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now