ODK Custom Validation

Hi,

I am an experienced programmer but relatively new to Android development and to the ODK/Javarosa ecosystem. I am hoping I can get some advice and possibly a code example to solve a problem I have.

I need to perform several custom validations/calculations of data entered in an ODK form. For example, I'd like to calculate a check digit algorithm and also calculate z-scores. Both of these are fairly simple in Java but not possible in XPath.

Can anyone provide advice on the best way to accomplish this? Ideally, I would like to add a separate package of custom functions that can be called with parameters from the forms.

Any help/guidance greatly appreciated.

Best wishes,

Kevin.

Hi Kevin,

I know of lots of hacky ways to do this (e.g., build your own copy of
Collect with your own build of JavaRosa), but I'd like to loop in some
folks who've been discussing the best way to do things like this at
https://github.com/opendatakit/xforms-spec.

Can you please file this as a new issue at
https://github.com/opendatakit/xforms-spec so we can start the
discussion on whether we should add this functionality to the ODK
tools. If we decide no, the discussion will still help explore all
your implementation options.

Thanks,

Yaw

ยทยทยท On Fri, Dec 30, 2016 at 8:44 PM, wrote: > Hi, > > I am an experienced programmer but relatively new to Android development and to the ODK/Javarosa ecosystem. I am hoping I can get some advice and possibly a code example to solve a problem I have. > > I need to perform several custom validations/calculations of data entered in an ODK form. For example, I'd like to calculate a check digit algorithm and also calculate z-scores. Both of these are fairly simple in Java but not possible in XPath. > > Can anyone provide advice on the best way to accomplish this? Ideally, I would like to add a separate package of custom functions that can be called with parameters from the forms. > > Any help/guidance greatly appreciated. > > Best wishes, > > Kevin. > > -- > You received this message because you are subscribed to the Google Groups "ODK Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit-developers+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

Hello Yaw.

Do you know if this was ever implemented?