A total noob in LiveCycle Designer.
I'm trying to get data from a Rest api and the returned data is in XML which I would like to parse.
Having trouble in JavaScript to connect to the API. As I understand XMLHttpRequest does not work in Designer.
I'm connecting to the API when you do exit* on a text field and want to fill some data in another field, so no submit action or so.
So I tried the Get-function in FormCalc instead, and then I get the data. But I'm unable to parse it in any good way in FormCalc.
So what to do? Can I connect to a Rest API in JavaScript or am I stuck with FormCalc and if so, how do I parse XML.
The FormCalc code looks something like this:
and the XML, or just plain string I guess, looks like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<geonames>
<totalResultsCount>1</totalResultsCount>
<code>
<postalcode>118 62</postalcode>
<name>Stockholm</name>
<countryCode>SE</countryCode>
<lat>59.33258</lat>
<lng>18.0649</lng>
<adminCode1>AB</adminCode1>
<adminName1>Stockholm</adminName1>
<adminCode2>0180</adminCode2>
<adminName2>Stockholm</adminName2>
<adminCode3/>
<adminName3/>
</code>
</geonames>
I want the totalResultsCount and I want the name, that's it :)