How to properly write calculation expression for XForm

595 Views Asked by At

I am creating a form using ODK Build. I believe there is something wrong with my binding syntax. In Build you just type in the expression in the input box (below):

enter image description here

I have entered: ${volume_environmental_sample_meters}*1000

When I export to xml it looks like the following code:

<bind nodeset="/data/volume_environmental_sample_liters" type="decimal" calculate="${volume_environmental_sample_meters}*1000"/>    

But when I validate it errors out and says:

org.javarosa.xform.parse.XFormParseException: Invalid calculate for the bind attached to "/data/volume_environmental_sample_liters" : Couldn't understand the expression starting at this point: ?${volume_enviro... in expression ${volume_environmental_sample_meters}*1000

1

There are 1 best solutions below

0
On

In ODK Build you must still write the binding syntax as follows:

calculate="${volume_environmental_sample_meters}*1000"