Group:  Other Microsoft Office Products ยป microsoft.public.infopath
Thread: How to select the last node value in a repeating table?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How to select the last node value in a repeating table?
gokou88 19.07.2006 18:55:02
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!!
RE: How to select the last node value in a repeating table?
S.Y.M. Wong-A-Ton 20.07.2006 18:19:02
Try using the last() function in an XPath filter like:

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

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


"gokou88" wrote:

[Quoted Text]
> 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!!
RE: How to select the last node value in a repeating table?
gokou88 20.07.2006 21:24:01
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" wrote:

[Quoted Text]
> Try using the last() function in an XPath filter like:
>
> /my:group/my:row[last()]
>
> ---
> S.Y.M. Wong-A-Ton
>
>
> "gokou88" wrote:
>
> > 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!!
RE: How to select the last node value in a repeating table?
S.Y.M. Wong-A-Ton 21.07.2006 18:08:02
Try

/my:HWForm/my:ApprovalGroup/my:PreApproval[last()]/my:PreApprovalName

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


"gokou88" wrote:

[Quoted Text]
> 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" wrote:
>
> > Try using the last() function in an XPath filter like:
> >
> > /my:group/my:row[last()]
> >
> > ---
> > S.Y.M. Wong-A-Ton
> >
> >
> > "gokou88" wrote:
> >
> > > 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!!
RE: How to select the last node value in a repeating table?
gokou88 21.07.2006 18:13:01
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" wrote:

[Quoted Text]
> Try
>
> /my:HWForm/my:ApprovalGroup/my:PreApproval[last()]/my:PreApprovalName
>
> ---
> S.Y.M. Wong-A-Ton
>
>
> "gokou88" wrote:
>
> > 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" wrote:
> >
> > > Try using the last() function in an XPath filter like:
> > >
> > > /my:group/my:row[last()]
> > >
> > > ---
> > > S.Y.M. Wong-A-Ton
> > >
> > >
> > > "gokou88" wrote:
> > >
> > > > 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!!
RE: How to select the last node value in a repeating table?
S.Y.M. Wong-A-Ton 21.07.2006 18:23:01
You're welcome. :)
---
S.Y.M. Wong-A-Ton


"gokou88" wrote:

[Quoted Text]
> 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" wrote:
>
> > Try
> >
> > /my:HWForm/my:ApprovalGroup/my:PreApproval[last()]/my:PreApprovalName
> >
> > ---
> > S.Y.M. Wong-A-Ton
> >
> >
> > "gokou88" wrote:
> >
> > > 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" wrote:
> > >
> > > > Try using the last() function in an XPath filter like:
> > > >
> > > > /my:group/my:row[last()]
> > > >
> > > > ---
> > > > S.Y.M. Wong-A-Ton
> > > >
> > > >
> > > > "gokou88" wrote:
> > > >
> > > > > 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!!

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net