InfoPath 2010/2013: Concat repeating table fields into one field with delimiter

Expect that you will create a summary section of a repeating table. In this sample we want to get all first names of a repeating table and want to use a semicolon as delimiter. We will use a calculate value to store all this names into one field. The result looks like this:

We just need some xpath values to achieve this goal.

xdMath:Eval(xdMath:Eval(my:Persons/my:Person, ‘concat(my:FirstName, “;”)’), “..”)

Just add this xpath code to a calculated value and set your values. As delimiter we use ; and concat it with the field my:FirstName. To get all values and not only the first one we need the math function eval. That’s it.

The article or information provided here represents completely my own personal view & thought. It is recommended to test the content or scripts of the site in the lab, before making use in the production environment & use it completely at your own risk. The articles, scripts, suggestions or tricks published on the site are provided AS-IS with no warranties or guarantees and confers no rights.

Dennis de Vries About Dennis de Vries
Loving SharePoint, Social Media and like to work together with creative people all over the world.

13 comments on “InfoPath 2010/2013: Concat repeating table fields into one field with delimiter

  1. Jeannine terblanche

    Hi

    Your formula work perfectly 🙂 Thank you!!!

    Is it possible to not show the last “;” though?

    Kind regards

  2. hi
    why my string returns ;;;;; ????
    without value of my field but when add row to repeating table then add “;” to my string?
    what is my problem?

  3. hi
    i want to cancat my fields in seperate line. is it possible that i use ENTER as delimiter??
    thanks

    • Hi, i would not recommend this – it might be possible – but it depends on how things like ENTER is interpreted, e.g.
      or \n\r or whatever. It’s better to use something like “;” or “#”

  4. Hi, for the above example, how can I get a calculated value that will look like this (or the nearest):
    Dennis – 21
    Karsten – 20
    Guru – 99

    *where the numbers are their ages.

    Thanks a bunch.

  5. Hi,

    I’ve tried to implement this, but it looks like it’s just repeating the 1st Row of Data.

    Here’s my formula:
    xdMath:Eval(xdMath:Eval(../my:group7/my:group8, ‘concat(../../my:group7/my:group8/my:HardwareConsolidatedType, “;”)’), “..”)

    Does anything stand out?

    Kind Regards,
    Matt

  6. TicoRicos

    Hi, the calculated value works perfectly… problem is: how do I promote it to the SP list so I can see it as a column? Can’t seem to find a way…

  7. Venkatesh

    My text field does not populate with the value and I have tried various versions of the same eval formula.
    This is my current formula –
    eval(eval(Person, ‘concat(xdXDocument:GetDOM(“FIM Approvers”)/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Approver_x0020_Name/pc:Person/pc:AccountId, “;”)’), “..”)

    where Person – Repeating Group
    Account ID – to be concatenated based on the person populated in the repeating table

  8. studs4eva

    For me this works for first record only . it always append same field. how can we do it for columns of same row ?

  9. how to concatenate values which have same country name, here for example, for “Germany”, records should get display : Dennis, Karsten.
    Is this is possible.
    please guide.

  10. Hi,

    I tried to implement this, but it looks like it’s just repeating the 1st Row of Data. and my my formula:

    xdMath:Eval(xdMath:Eval(../my:group2, ‘concat(../../my:group1/my:group2/my:ddlProject, “|”)’), “..”)

    Why?

  11. Hi,

    I tried to implement this, but it looks like it’s just repeating the 1st Row of Data. and my my formula:

    xdMath:Eval(xdMath:Eval(../my:group2, ‘concat(../../my:group1/my:group2/my:ddlProject, “|”)’), “..”)

    Why?

  12. This might help some people who read this later… This is what works for me in LIBRARY-based form. Create a text field and make the default value of it be:

    substring-after(eval(eval(Field1, ‘substring-after(concat(. = “”, “, “, .), “false”)’), “..”), “, “)

    Where “Field1” would be the field in your repeating table that you want to grab.

    If you run into any issues, try retyping in the quotation marks since sometimes they come over differently from other fonts compared to what InfoPath wants you to be using.

    This value will add a comma and a space between your items and then remove the last comma – for example:

    Apple, Banana, Orange

    If you have a LIST-based form, try this instead:

    substring-before(concat(eval(eval(Field1[. != “”], ‘concat(., “, “)’), “..”), “,”), “, ,”)

    I got this from another site at some point and saved it in my notes – there’s no way I could’ve ever come up with this on my own… 🙂

Submit comment

Allowed HTML tags: <a href="http://google.com">google</a> <strong>bold</strong> <em>emphasized</em> <code>code</code> <blockquote>
quote
</blockquote>

Please fill in the captcha: * Time limit is exhausted. Please reload CAPTCHA.