API getURL multiple records
Hello,
I have created the following script:
- //BASE 64 Encryptie van gebruikersnaam, wachtwoord van Undagrid
- headerMap={ "Authorization" : "Basic secretcode=" };
- x = getUrl(("https://api.url.com/history?count=1"),headerMap);
- nodeName = x.executeXPath("/root/json/nodeName/text()");
- nodeUuid = x.executeXPath("/root/json/nodeUuid/text()");
- N=(x.executeXPath("/root/json/value/x/text()")).toDecimal();
- E=(x.executeXPath("/root/json/value/y/text()")).toDecimal();
- dX=((N - 155000) * 0.00001.toDecimal());
- dY=((E - 463000) * 0.00001.toDecimal());
- SomN=((3235.65389 * dY + -32.58297 * dX.power(2) + -0.2475 * dY.power(2) + -0.84978 * dX.power(2) * dY + -0.0655 * dY.power(3) + -0.01709 * dX.power(2) * dY.power(2) + -0.00738 * dX + 0.0053 * dX.power(4) + -0.00039 * dX.power(2) * dY.power(3) + 0.00033 * dX.power(4) * dY + -0.00012 * dX * dY)).toDecimal();
- SomE=((5260.52916 * dX + 105.94684 * dX * dY + 2.45656 * dX * dY.power(2) + -0.81885 * dX.power(3) + 0.05594 * dX * dY.power(3) + -0.05607 * dX.power(3) * dY + 0.01199 * dY + -0.00256 * dX.power(3) * dY.power(2) + 0.00128 * dX * dY.power(4) + 0.00022 * dY.power(2) + -0.00022 * dX.power(2) + 0.00026 * dX.power(5))).toDecimal();
- Latitude=(52.15517 + SomN / 3600).round(6);
- Longitude=(5.387206 + SomE / 3600).round(6);
- URL_Google_Maps="https://www.google.nl/maps/place/" + Latitude + "+" + Longitude + "/";
- insert into Koppeling_Undagrid
- [
- Added_User = zoho.loginuser
- CT_Containernummer = nodeUuid
- CT_Serienummer = nodeName
- E2 = E
- E3 = Latitude.toDecimal()
- Locatie = (((((((((("<a href= " + URL_Google_Maps + " target=_blank><div width = '100px' height = '100px' style='border: 0px solid #A4A4A4;'> <img src='http://maps.googleapis.com/maps/api/staticmap?center=") + Latitude) + "+") + Longitude) + "+") + "&zoom=10&markers=size:mid%7Ccolor:0x00b0f4%7Clabel:Container%7C") + Latitude) + "+") + Longitude) + "+") + "&size=100x100&sensor=true'></div></a>"
- N2 = N
- N3 = Longitude.toDecimal()
I so did manage to create 1 record in the form "Koppeling_Undagrid", convert the coördinates of the object to GPS coördinaties and create a map in Google Maps.
But as you can see in the API URL, it only fetches 1 record. But I want to fetch 10 records.
How can I fix this problem? So the issue is:
1. Fetch multiple record
2. Created multiple records
Hope someone can help me!
Greatings,
Erwin