Using search() in calculate

1. What is the problem? Be very detailed.
I have tables with hundreds of rows that are searched numerous times in my survey, making the whole algorithm unusably slow. Until now I was putting the tables in the choices list. I understand that using csv files will be much faster. I successfully implemented such a solution using pulldata() in a calculate field. However, I need to use regular expressions to find the right row to pickup. For example I will have a rows with minimum and maximum age ( 'age_min', 'age_max'). There is no pulldata functionality to solve that problem, as it can only pick up statically defined fields.
I would like to use serch() in the calculate field with an expression like: ${user_age} >= age_min and ${user_age} < age_max.
But I have not found any case where search is used in calculate, nor have I found documentation about search() function variables.

I would like to know if someone can help out, providing documentation, use cases or suggesting other solutions.

2. What app or server are you using and on what device and operating system? Include version numbers.
odk collect and enketo. Once finished I am planing to upload it to Commcare.

3. What you have you tried to fix the problem?
pulldate, internal tables

search function works more with text values so it handles options like:

  • contains
  • startswith
  • endswith
  • matches

so your case might be not possible to achieve but who knows maybe there is someone on this forum who was able to do something like that somehow, from my experience: never say never so I'm also curious.

When it comes to search function here you can find a good video about it: