Filtering in repeat group

Hi All,

I try to pre-filter the options based on categories using a Lookuptable
e.g.:

repeat group
Q1 select category
Q2 select type

When I simply drag the filter it filters fine for the first repeat (as in
normal forms), but the second repeat is still filtered over the first
answer, which means an absolute path has been made, instead of a relative
one.

The wiki documentation mentions something on filtering inside repeat groups
and mentions specifically the current() function for lookup tables, but
does not explain how to use it:

current(): This will return the question. Its needed if you’re writing

logic in the repeat for something like a lookup table.

Source: Using Repeat Groups in the Form Builder
https://confluence.dimagi.com/display/commcarepublic/Using+Repeat+Groups+in+the+Form+Builder

I cannot find any other entry on the current() except for this page
mentioned above, can somebody explain how to use it?

Regards Jos

Hi Jos,

Sorry for the confusion on this point, using repeats and lookup tables can
get complex.

I’ve added some info to that page which may clarify how this works a bit.
Can you read that over and let me know if it answers your questions?

-Clayton

··· On Tue, Apr 18, 2017 at 12:41 PM, Jos van der Ent wrote:

Hi All,

I try to pre-filter the options based on categories using a Lookuptable
e.g.:

repeat group
Q1 select category
Q2 select type

When I simply drag the filter it filters fine for the first repeat (as in
normal forms), but the second repeat is still filtered over the first
answer, which means an absolute path has been made, instead of a relative
one.

The wiki documentation mentions something on filtering inside repeat
groups and mentions specifically the current() function for lookup tables,
but does not explain how to use it:

current(): This will return the question. Its needed if you’re writing

logic in the repeat for something like a lookup table.

Source: Using Repeat Groups in the Form Builder
https://confluence.dimagi.com/display/commcarepublic/Using+Repeat+Groups+in+the+Form+Builder

I cannot find any other entry on the current() except for this page
mentioned above, can somebody explain how to use it?

Regards Jos


You received this message because you are subscribed to the Google Groups
"commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Clayton,
Yes the addition helped, it is working now.

Thanks again for the support!

Regards Jos

Just writing here that what worked for me, to reference a field in current repeat loop is current()/../my_field_id.

#IT4LIFE