intelligent concat of Repeating Table - InfoPath Dev
in

InfoPath Dev

intelligent concat of Repeating Table

Last post 10-19-2007 01:08 PM by adamrharding. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-05-2007 02:26 AM

    • vansen
    • Not Ranked
    • Joined on 10-05-2007
    • Posts 2

    intelligent concat of Repeating Table

    Hi Everyone,

     i need to find a solution to concat fields of an repeating table to have them comma separated (not behind the last one) and before the last item it should instert an "and" word.

    So if i got my table:

    Text1

    Text2

    Text3

    it should calculate the following : Text1, Text2 and Text3

    Is there any chance to achieve this without writing code ? It's not that i dislike writing code but the people here designing forms don't know how to write code (and don't wanna learn ;)

    Thanks !

  • 10-05-2007 03:12 AM In reply to

    Re: intelligent concat of Repeating Table

    Hello

    Use this formula

    concat(field1, ",", " ", field2, " ", "and", " ", field3)

    This should help you

    Kalyan G Reddy
    Infopath MVP 2007 and 2008
  • 10-05-2007 05:05 AM In reply to

    • vansen
    • Not Ranked
    • Joined on 10-05-2007
    • Posts 2

    Re: intelligent concat of Repeating Table

    ok, big thanks. But what if i have a Repeating table with a variant number of fields? Also how ist the "and" Keyword getting into this ?

  • 10-08-2007 04:11 AM In reply to

    Re: intelligent concat of Repeating Table

    Hi

    First question, are the text fields in the repeating table?  Second question, if they are, are you trying to display the concat outside of the repeating table?

    Thirdly, I think what you are asking is the you have a single Field in a repeating table and you are looking to concatenate all the instances of field 1 in the form

    "Field1a", ", " "Field1b", " and ", "Field1c"

    Natively, InfoPath does not support this funcitonality and I am sorry to say you will need code to achieve this.

    Hopefully it is not that compicated

    If it isn't that complicated then variant field will either introduce extra commas or spaces if they are not populated, just add all the field in with ", " between them and it will work fine.  You might want to consider the spaces then it would look slightly less obvious

     

    Adam Harding
    Wales
    UK
  • 10-19-2007 01:08 PM In reply to

    Re: intelligent concat of Repeating Table

    Hello again

    Just a quick post as I have found the code to solve the problem

    the blog (below) is all about looping formulas

    http://blogs.msdn.com/infopath/archive/2006/04/05/569338.aspx

    David Airapetyan gives a great example of how to use the Eval function that returns data from a list of nodes without specifying the parent and the Concat function you are probably familiar with.  Great article, short, informative and will do exactly what you are after and explain why.

    Happy to help and thanks to David for the blog

    Cheers

    Adam Harding
    Wales
    UK
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.