Substring functions

Is the function substring-before() now working in KoboCollect?
Is there an equivalent function as the find() in Excel?
Thanks

Hello,

You may check this (and tell the community?):

  • using the XLSForm Online Validator (will show you if it is working for ODKCollect and Enketo)
  • trying to deploy in KoBo (for KoboCollect)
  • trying to Preview in Enketo (for Enketo)…

There is a complex workaround (with regex):
https://forum.getodk.org/t/string-before-and-string-after-function-support/10153/6

To check for a substring or letter in a given string, contains() function may help you. But unfortunately not providing the position, only boolean.

If your string is numeric or can be casted to numeric, you could work with numeric functions/operators to cut of parts, like mod or div.

You might even create a complex workaround to find a position by using a repetitive combination of if, string-length, substring.

1 Like

@csteen, kindly please be informed that substring-before should now work with KoBoToolbox. FYI, please follow the post discussed previously: