Display Last Value from Field in Repeating Table - InfoPath Dev
in

InfoPath Dev

Display Last Value from Field in Repeating Table

Last post 03-19-2013 11:39 AM by Hilary Stoupa. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 03-18-2013 10:26 AM

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Display Last Value from Field in Repeating Table

    I have a form that will be filled out and stored on a Sharepoint site.  On page 1 of the form there is a repeating table that contains 3 field...Revision, Description, and Date.  Each time a user revised the form they will add these three fields and the form will always display the history of the changes. 

     Page 2 has a field where we want to show only the most current revision level for the document, so if Page 1 shows 3 lines, Rev A, Rev B, Rev C, page 2 should only show the most recent revision, Rev C.

     I don't have any idea how to create the field on page 2 that will only see the latest revision from Page 1.  Is this possible?

     Sincerely,

    JudyH

  • 03-19-2013 06:23 AM In reply to

    Re: Display Last Value from Field in Repeating Table

    Hi Judy,

    Take a look at the Change History XTPs available on this site. They should satisfy your requirement.

    http://www.infopathdev.com/files/folders/templateparts/entry60775.aspx

    http://www.infopathdev.com/files/folders/templateparts/entry60774.aspx

    Good luck!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 03-19-2013 07:55 AM In reply to

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Re: Display Last Value from Field in Repeating Table

    I tried to access the above but had no luck.

    I have been able to figure this out a little.

    My repeating table is:

    RevTable   :   RevGroup   :   fldQPRev. 

    The field I want to set up to display the last occurance of fldQPRev is fldRevCopy. 

    The formula I have in fldRevCopy is:  RevGroup[last()] / fldQPRev

     All fields are marked as Text HOWEVER, if I enter fldQPRev with a numeric value, fldRevCopy works fine.  If I enter it the way I want it, with A, B, C, all fldRevCopy shows is NaN?  Why is it looking for a numeric value????

  • 03-19-2013 09:15 AM In reply to

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Re: Display Last Value from Field in Repeating Table

    Ironically, I found a document that clearly shows how to write the Function statement in my field.  Using the data above it would be:

    RevGroup[last()]/fldQPRev

    Unfortuantely, it will not accept this statement.  It wants you to write RevGroup[last()] / fldQPRev and then it will accept it. 

    So then, when I get it to accept the statement as not having errors it will only recognize numeric values and not alpha.  It makes no sense to me...hope someone can help.

  • 03-19-2013 09:49 AM In reply to

    Re: Display Last Value from Field in Repeating Table

     Well - your expression with the spaces around the "/" is division - which explains the NaN error.

    Try using the compete XPath - you are probably using the default "my" namespace, so it would look like:

    my:RevGroup[last()]/my:fldQPRev

    Hilary Stoupa

  • 03-19-2013 10:06 AM In reply to

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Re: Display Last Value from Field in Repeating Table

    Thanks so much, Hilary, for your suggestion.  I appreciate it so much.  

    I entered my:RevGroup[last()]/my:fldQPRev and received the verification error message:

    "my:RevGroup/my:fldQPRev" does not point to a valid location path of a field or group

     

     

  • 03-19-2013 10:16 AM In reply to

    Re: Display Last Value from Field in Repeating Table

     I think you should use the field picker to select fldQPRev. Then check the little checkbox in the formula editor for Edit XPath. Then type in [last()] next to the repeating group- RevGroup. That may be the most straightforward approach.

    Hilary Stoupa

  • 03-19-2013 11:09 AM In reply to

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Re: Display Last Value from Field in Repeating Table

    Hilary, you are so kind.  I tried what you said and it says "Expected value type:  end-of-string"

    This is so frustrating.  I've researched so much on the internet, in archives and nothing seems to help. 

  • 03-19-2013 11:14 AM In reply to

    Re: Display Last Value from Field in Repeating Table

    Can you paste in exactly what you have in the formula editor? Check the Edit XPath box first... :)

    Hilary Stoupa

  • 03-19-2013 11:22 AM In reply to

    • JudyH
    • Not Ranked
    • Joined on 03-18-2013
    • Posts 6

    Re: Display Last Value from Field in Repeating Table

    ../my:RevTable/my:RevGroup[last()]../my:RevTable/my:RevGroup/my:QPRev

     If you want to e-mail me, can send you the form itself.  I am at [email protected]

     I can't tell you how much I appreciate the time you're taking.

  • 03-19-2013 11:39 AM In reply to

    Re: Display Last Value from Field in Repeating Table

     You just need this part:

    ../my:RevTable/my:RevGroup[last()]/my:QPRev

    The last() function goes on the repeating group.

    Hilary Stoupa

Page 1 of 1 (11 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.