Actually not even the filter for the com field is working...it doesn't seem
like it is evaluating ../dept as anything
···
On Tuesday, August 30, 2016 at 1:53:12 PM UTC-5, Nishant Kishore wrote:
>
> Hi All,
>
> I have a series of lookup tables inside an open repeat group:
>
> repeat
> -dept: what dept do you live in
> -com: what commune do you live in
> -sc: what section communale do you live in
>
> I'm trying to use filter the options for the lookup tables by previous
> answers so that com is filtered by dept and sc is filtered by com and dept.
>
> This works fine for the com field which is filtered by the choice for dept
>
> However when I try to do the same for the sc field I get an error where it
> tries to evaluate ../dept at the instance(sc)
>
> I've take out one of the filters and no longer get the error.
>
> Any thoughts would be great!
>
> Best,
>
> Nishant
>
which seems to be causing the error since the ".." evaluates back to the
instance rather than the question list it is in.
Anybody know the proper syntax for this?
···
On Tuesday, August 30, 2016 at 1:53:12 PM UTC-5, Nishant Kishore wrote:
>
> Hi All,
>
> I have a series of lookup tables inside an open repeat group:
>
> repeat
> -dept: what dept do you live in
> -com: what commune do you live in
> -sc: what section communale do you live in
>
> I'm trying to use filter the options for the lookup tables by previous
> answers so that com is filtered by dept and sc is filtered by com and dept.
>
> This works fine for the com field which is filtered by the choice for dept
>
> However when I try to do the same for the sc field I get an error where it
> tries to evaluate ../dept at the instance(sc)
>
> I've take out one of the filters and no longer get the error.
>
> Any thoughts would be great!
>
> Best,
>
> Nishant
>
Lookup table filters inside repeats are a bit confusing because the context
of the reference that you are making inside of the filter expression
actually resets to the context of the full form, meaning that a reference
to the form won't automatically contextualize to the particular repeat
instance you are in.
In order to make the reference you mentioned, you'll need to begin a
relative reference with a function, current(), this will make your
reference "start" at the context of the current question, so your filter
would be
dept_id = current()/../HH_travel_Dept
Let me know if that doesn't work.
-Clayton
···
On Tue, Aug 30, 2016 at 3:54 PM, Nishant Kishore wrote:
So I see that when I write the entire question location in the filter
section the query looks like this:
Sorry for the delayed response. It works though with a bit more editing
since my question was within another question list within the repeat group.
I'm going to leave these two links here for people exploring this issue in
the future:
Nishant Kishore
Data Manager | Malaria Zero: The Alliance for a Malaria-free Haiti | CDC
RPCV: Nicaragua 2011-2014 nish.kishore@gmail.com
M: +18044371312
Skype: nishant.kishore
···
On Wed, Aug 31, 2016 at 8:56 AM, Clayton Sims wrote:
Hi Nishant,
Lookup table filters inside repeats are a bit confusing because the
context of the reference that you are making inside of the filter
expression actually resets to the context of the full form, meaning that a
reference to the form won't automatically contextualize to the particular
repeat instance you are in.
In order to make the reference you mentioned, you'll need to begin a
relative reference with a function, current(), this will make your
reference "start" at the context of the current question, so your filter
would be
Please assist on where to insert a logic. i have a scenario that ward, and village are lookup tables inside a repeat group. One first iteration goes well, but the second iteration village returns the error below
XPath nodeset has more than one node [/data/beneficiaries_and_incident_information[1]/ward[1];/data/beneficiaries_and_incident_information[2]/ward[1]]; cannot convert multiple nodes to a raw value. Refine path expression to match only one node.
Hi Clayton
Your support is greatly appreciated
I applied as you indicated and it did not work with me. What do you think is the solution?
Governorate = current()/../#form/general_information/gov
I have a repeatable section. In the repeatable I want to choose a governorate from the lookup table and then a region from lookup tables.. The choices in regions will appear based on the governorate selection.
@Ali_Agha I don't think you can combine the path syntax (current()/../) with the easy reference (the thing that says "gov"). Does it work if you just do this?