After returning a Json from a PHP script, I try to transform it so that I can add it to the “Add Makers from Json” event of the Google Maps component.
This is the return of PHP.
I imagined putting the “Add Makers” event inside the loop for each iteration, to create a Maker. Clear the list and go on creating the list and clearing that list.
The result of the first list and the second (the one that should create the Maker). I put empty list to clear the second list, to make 1 Maker at each iteration. But it seems that the Empty List does not clear and the second list is left without the comma ", 'to separate items from the list.
In my algorithm, it was to create the first json, send it to “Add Maker”, clear the list and send the next Json. But he is not doing it because the list is not being a list and he is forming a Json with 3 lists without the comma “,”.
Why aren’t you clearing the list and consequently the Json list is not accepted?
Response Content = [{“ncodprofissional”:“1”,“cnomeprof”:“CARLOS FREDERICO”,“nlat”:"-21.75559000",“nlong”:"-41.32780400"},{“ncodprofissional”:“2”,“cnomeprof”:“PEDRO HENRIQUE”,“nlat”:"-21.75614400",“nlong”:"-41.32730600"},{“ncodprofissional”:“3”,“cnomeprof”:“PAULO CESAR”,“nlat”:"-21.75435400",“nlong”:"-41.32796400"}] Algorithm
List0 receives JsonTextDecode from Response Content
Loop in List0 Start 1 to N
List1 receives itemN from List0;
List2 receives List1;
Add Maker method receives List1
Clean List1
End Loop
Dear I need to clean up to send to the Add Maker method. One by One … and the “Create Empty List” is not clearing. As a result, a list is created with 3 sublists without being separated by a comma “,”. It’s in the image.
is not necessary if you use the same list variable (here coordenadas) and set it to something else, its previous value will be overwritten
list items never are separated by comma, what you are looking for is probably the list to csv row block, which converts a list into a csv row, which seperates list items by comma?
This is an example of the script return: [{“ncodprofissional”: “1”, “cnomeprof”: “CARLOS FREDERICO”, “nlat”: “- 21.75559000”, “nlong”: “- 41.32780400”}, {"ncodprofessional “:” 2 “,” cnomeprof “:” PEDRO HENRIQUE “,” nlat “:” - 21.75614400 “,” nlong “:” - 41.32730600 “}, {” ncodprofissional “:” 3 “,” cnomeprof “:” PAUO CESAR “,” nlat “:” - 21.75435400 “,” nlong “:” - 41.32796400 "}]
And this is an example of a string that I must create to pass as a parameter to the Add Makers method (already tested): [{lat: -21.755590, lng: -41.327804, color: 135, title: “Joao Carlos”}]
I just didn’t insert the color and title.
If there are N parameters to pass to Add Maker, they are separated by commas “,”. I already tested it and it works.