How to select the last node value in a repeating table?

G

gokou88

Anybody have a code script to select the LAST node value of a repeating
table? I have code to select the FIRST, or all of the nodes.

Thanks!!
 
S

S.Y.M. Wong-A-Ton

Try using the last() function in an XPath filter like:

/my:group/my:row[last()]
 
G

gokou88

Hi S.Y.M. Wong-A-Ton,
Thanks for your reply, I got the script to return the row data (all fields).
Now how do I limit the value to just the first field of the last row? Here
is my script.

var to =
getNodeValue("/my:HWForm/my:ApprovalGroup/my:preApproval/my:preApprovalName[last()]")

/my:preApproval is the repeating table
/my:preApprovalName is the first field of two in the table

S.Y.M. Wong-A-Ton said:
Try using the last() function in an XPath filter like:

/my:group/my:row[last()]

---
S.Y.M. Wong-A-Ton


gokou88 said:
Anybody have a code script to select the LAST node value of a repeating
table? I have code to select the FIRST, or all of the nodes.

Thanks!!
 
S

S.Y.M. Wong-A-Ton

Try

/my:HWForm/my:ApprovalGroup/my:preApproval[last()]/my:preApprovalName

---
S.Y.M. Wong-A-Ton


gokou88 said:
Hi S.Y.M. Wong-A-Ton,
Thanks for your reply, I got the script to return the row data (all fields).
Now how do I limit the value to just the first field of the last row? Here
is my script.

var to =
getNodeValue("/my:HWForm/my:ApprovalGroup/my:preApproval/my:preApprovalName[last()]")

/my:preApproval is the repeating table
/my:preApprovalName is the first field of two in the table

S.Y.M. Wong-A-Ton said:
Try using the last() function in an XPath filter like:

/my:group/my:row[last()]

---
S.Y.M. Wong-A-Ton


gokou88 said:
Anybody have a code script to select the LAST node value of a repeating
table? I have code to select the FIRST, or all of the nodes.

Thanks!!
 
G

gokou88

That did the trick!! Thank you so much!! I can't believe that didn't come
across my mind. :p

S.Y.M. Wong-A-Ton said:
Try

/my:HWForm/my:ApprovalGroup/my:preApproval[last()]/my:preApprovalName

---
S.Y.M. Wong-A-Ton


gokou88 said:
Hi S.Y.M. Wong-A-Ton,
Thanks for your reply, I got the script to return the row data (all fields).
Now how do I limit the value to just the first field of the last row? Here
is my script.

var to =
getNodeValue("/my:HWForm/my:ApprovalGroup/my:preApproval/my:preApprovalName[last()]")

/my:preApproval is the repeating table
/my:preApprovalName is the first field of two in the table

S.Y.M. Wong-A-Ton said:
Try using the last() function in an XPath filter like:

/my:group/my:row[last()]

---
S.Y.M. Wong-A-Ton


:

Anybody have a code script to select the LAST node value of a repeating
table? I have code to select the FIRST, or all of the nodes.

Thanks!!
 
S

S.Y.M. Wong-A-Ton

You're welcome. :)
---
S.Y.M. Wong-A-Ton


gokou88 said:
That did the trick!! Thank you so much!! I can't believe that didn't come
across my mind. :p

S.Y.M. Wong-A-Ton said:
Try

/my:HWForm/my:ApprovalGroup/my:preApproval[last()]/my:preApprovalName

---
S.Y.M. Wong-A-Ton


gokou88 said:
Hi S.Y.M. Wong-A-Ton,
Thanks for your reply, I got the script to return the row data (all fields).
Now how do I limit the value to just the first field of the last row? Here
is my script.

var to =
getNodeValue("/my:HWForm/my:ApprovalGroup/my:preApproval/my:preApprovalName[last()]")

/my:preApproval is the repeating table
/my:preApprovalName is the first field of two in the table

:

Try using the last() function in an XPath filter like:

/my:group/my:row[last()]

---
S.Y.M. Wong-A-Ton


:

Anybody have a code script to select the LAST node value of a repeating
table? I have code to select the FIRST, or all of the nodes.

Thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top