Array of nodes to single value

Best practice question here.

I have a node (header) with a series of subnodes (lines). Each line contains a value for an employee (the value is the same for every line).

I need to retrieve a single value so I can add it up to the header. Clearly I cannot simply use the value as is because it will give the message “subpath field resolves to an array of nodes”.

What would be the best way to get a single value from the line array out so i can put it into the header?

Hopefully that makes sense

If you only care about using the value for the first available subnode, then append [1] to the data path by hand, e.g.

/root/parent/child[1]

That will select the first available child node.

exactly what I need. thanks

so i finally got around to working on this and am still getting the error…

Subpath field [sotransitems/sotransitem/employeeid[1]] resolves to an array of nodes.

thoughts?

UPDATE:
Nevermind. I realized it as soon as i hit send. I needed to add the [1] to a node higher up the chain. got it now