1. What is the problem? Be very detailed.
I used hidden type to hold a value to use in a relevance calculation inside repeat question. But unfortunately using that mentioned type, relevance is not working. When i tried to use hidden type on a single question it is working well but does not inside repeat question .
2. What app or server are you using and on what device and operating system? Include version numbers.
Use version android api 15-28, Emulators and real device
4. What steps can we take to reproduce the problem?
Create questions inside repeat
Set a value on a hidden type(e.g age) inside repeat
Create a text type question e.g Education Type and set the relevance calculation if(age > 13 and age < 17) means "High School" and show high school questions.
Bit of a stab in the dark, but it sounds like pre-populated elements in the instance XML might not be getting replicated when creating new repeat group instances? @Grzesiek2010 is this something that can be easily confirmed?
[all 'hidden' does is pre-populate static values in the instance XML. So this may have nothing to do with relevance calculations per se.... If these defaults arent getting replicated when new groups are added to the instance XML for a repeat group, this might explain why any calculations - relevance or otherwise - that happen to reference these instance XML elements are misbehaving]
Can you please describe what you expect the form shared here to do? The user_id and no_of_children fields have nothing in the form that will set their values. You mention wanting to use an external app but you don't have any of what is described in the documentation. Can you please describe exactly what you are doing to set those values?
Hello @LN , thanks for the reply and sorry for the short details.
Here's what i am currently implementing:
Launch ODK Collect and map the intent values to the questions from an external app. I populate the values on the questions(single or repeat) by manipulating the instance xml. I am not sure if this is a good solution though but the testing works well on my side and don't have issues on the performance prior on launching the form.
How do i map the values unto the questions?
-I get the TreeElement from the form instance root. Using the extras hashmap data from an external app and TreeElement from the form i just match the key with the tree element name and set the answer.
How do i know that the data being passed are working well?
Using child_age(hidden type) is not working on the relevance calculation inside repeat.
begin_group school type question should be visible under "Jose Maria" since his age is 15.
relevance is ${child_age} > 13 and ${child_age} < 17
How can I say that this might be a bug on the form?
Using text type(child_age_text) everything works well but using hidden type does not. I think the 2 types(hidden and text) are the same it just that hidden type is hidden from the form.
That's beyond the scope of typical usage! If you think there might be a bug, please build a form that demonstrates that bug without the unusual use of an external application. For example, you could populate those fields with a calculation.
Since it sounds like you've forked Collect and are modifying its code, you might want to step through a debugger and make sure the values you expect are there when the expressions are evaluated.