I have been experimenting with fixtures and have the example working.
In my use case I want to select a value from a large table by row then
field.
I have the row syntax i.e.
instance('districts')/district_list/district[1]/name this gets me the row
by number and the field.
I would like to replace the number and the field with values generated in
the form. i.e. instance('districts')/district_list/district[/data/rownumber
]//data/fieldname.
XPath isn't my forte some any help much appreciated.
I have been experimenting with fixtures and have the example working.
In my use case I want to select a value from a large table by row then
field.
I have the row syntax i.e.
instance('districts')/district_list/district[1]/name this gets me the row
by number and the field.
I would like to replace the number and the field with values generated in
the form. i.e. instance('districts')/district_list/district
[/data/rownumber]//data/fieldname.
XPath isn't my forte some any help much appreciated.
Looking at the filter, that allows me to filter by value in a field. What I
am looking to do is to get a value from a row/field intersection, much like
vLookup in excel or the value from a place in an array i.e. array[2,2].
I am sure it's not that hard just can't get my head around it!
I have been experimenting with fixtures and have the example working.
In my use case I want to select a value from a large table by row then
field.
I have the row syntax i.e.
instance('districts')/district_list/district[1]/name this gets me the row
by number and the field.
I would like to replace the number and the field with values generated in
the form. i.e. instance('districts')/district_list/district
[/data/rownumber]//data/fieldname.
XPath isn't my forte some any help much appreciated.
If I'm understanding correctly you want to select a fixture entry based
both on its row number and a value in one of its fields. In that case,
you'll want to use something like this
Please let me know if I'm misunderstanding you or this isn't clear enough.
Best,
Will
···
On Sun, Apr 6, 2014 at 8:15 AM, Tim Butler wrote:
Hi Cory,
Thanks for this.
Looking at the filter, that allows me to filter by value in a field. What
I am looking to do is to get a value from a row/field intersection, much
like vLookup in excel or the value from a place in an array i.e. array[2,2].
I am sure it's not that hard just can't get my head around it!
I have been experimenting with fixtures and have the example working.
In my use case I want to select a value from a large table by row then
field.
I have the row syntax i.e.
instance('districts')/district_list/district[1]/name this gets me the row
by number and the field.
I would like to replace the number and the field with values generated
in the form. i.e. instance('districts')/district_list/district
[/data/rownumber]//data/fieldname.
XPath isn't my forte some any help much appreciated.
instance('districts')/district_list/district[/data/rownumber] gives me the
row,
the /data/[fieldname=value_from_form]/ gives me the column
and the last is the result field_you_want?
I will give this a go tomorrow.
Thanks for the help.
Best
Tim
···
On 6 Apr 2014 20:09, "William Pride" wrote:
Tim,
If I'm understanding correctly you want to select a fixture entry based
both on its row number and a value in one of its fields. In that case,
you'll want to use something like this
Looking at the filter, that allows me to filter by value in a field. What
I am looking to do is to get a value from a row/field intersection, much
like vLookup in excel or the value from a place in an array i.e. array[2,2].
I am sure it's not that hard just can't get my head around it!
I have been experimenting with fixtures and have the example working.
In my use case I want to select a value from a large table by row then
field.
I have the row syntax i.e.
instance('districts')/district_list/district[1]/name this gets me the row
by number and the field.
I would like to replace the number and the field with values generated
in the form. i.e. instance('districts')/district_list/district
[/data/rownumber]//data/fieldname.
XPath isn't my forte some any help much appreciated.
instance('districts')/district_list/district[number(/data/rownumber)]/name
with the number wrap I get the correct row!
With this I get the desired result.
For the second half I am still confused.
The /data/[fieldname=value_from_form]/field_you_want part I cannot make to
work.
I understand that I am selecting a field by name what I don't understand is
the actual syntax. So if I had a single drop down name fieldname1 that had
name and state_id as options how do I put that in place of name in the
above?
Thanks for your patience.
Tim
···
On Sunday, 6 April 2014 21:35:21 UTC+1, Tim wrote:
>
> Hi Will,
>
> My understanding of this says
>
> instance('districts')/district_list/district[/data/rownumber] gives me the
> row,
>
> the /data/[fieldname=value_from_form]/ gives me the column
>
> and the last is the result field_you_want?
>
> I will give this a go tomorrow.
>
> Thanks for the help.
>
> Best
>
> Tim
> On 6 Apr 2014 20:09, "William Pride" wrote:
>
>> Tim,
>>
>> If I'm understanding correctly you want to select a fixture entry based
>> both on its row number and a value in one of its fields. In that case,
>> you'll want to use something like this
>>
>>
>> instance('districts')/district_list/district[/data/rownumber]/data/[fieldname=value_from_form]/field_you_want
>>
>> Please let me know if I'm misunderstanding you or this isn't clear enough.
>>
>> Best,
>> Will
>>
>
We've moved this discussion off users as it was getting very
domain-specific.
Best,
Will
···
On Mon, Apr 7, 2014 at 6:13 AM, Tim wrote:
Hi Will
I have now got to the following:
instance('districts')/district_list/district[number(/data/rownumber)]/name
with the number wrap I get the correct row!
With this I get the desired result.
For the second half I am still confused. The /data/[fieldname=
value_from_form]/field_you_want part I cannot make to work.
I understand that I am selecting a field by name what I don't understand
is the actual syntax. So if I had a single drop down name fieldname1 that
had name and state_id as options how do I put that in place of name in the
above?
Thanks for your patience.
Tim
On Sunday, 6 April 2014 21:35:21 UTC+1, Tim wrote:
Hi Will,
My understanding of this says
instance('districts')/district_list/district[/data/rownumber] gives me
the row,
the /data/[fieldname=value_from_form]/ gives me the column
If I'm understanding correctly you want to select a fixture entry based
both on its row number and a value in one of its fields. In that case,
you'll want to use something like this