We need an Orbeon form to do the following:
I'm stuck with how to pass the Northing/Easting into the API, and how to extract the Lat/Long from the returned data (see test form https://demo.orbeon.com/demo/fr/orbeon/builder/edit/41dfb267bb328e5e40037c0ce049bd13d947cc9b)
Any help would be greatly received.
Many thanks.
PeteA
You were almost there. I think the main thing is that URL parameters in the HTTP service editor are for things that end up as ?easting=429157&northing=623009
in the URL, but you want to have those values as part of the path, as in /429157/623009
. To do this, you need to use the following expression for the URL, which uses value templates, and the fr:control-string-value()
function (doc), which results in the following URL.
https://api.getthedata.com/bng2latlong/{fr:control-string-value('Easting')}/{xxf:instance('fr-form-instance')//Northing}
I have also updated your form on demo with those changes.