Dear All,
I’m new to KoBoToolbox, so, i would like to know if we use programming statements such as Do, While, For, If for constructing expressions.
Another, i would like to know if i can construct my own user defined function to validate data.
ODK Collect/KoboCollect is build upon the W3C XForms standard, which in turn use XPath expressions for its calculations and expressions. Currently XPath 1.0 - plus a few extensions - are supported, which unfortunately doesn’t include the likes of do/while/for loops, although the if() function is supported.
[Realistically, full advanced XPath 2.0/3.0 support probably isn’t coming anytime soon - its nontrivial to implement].
Once you added you own function(s) you’d need to rebuild your client app from source - eg KoboCollect, ODK Collect - using your new javaRosa library, at which point you’d be able to use these in your own XForms. Alternatively (and preferably?), if you can make a good case why these changes should go into mainline, then you may be able to submit a javaRosa PR (Pull Request) and the open source maintainers will consider pulling your changes in and update the code-base, which would appear in the next release.