Answered by:
How to concatenate text fields from a Repeating Table (InfoPath 2010)

Question
-
Hi,
I have been trying to concatenate the output of a field from a repeating table to a single text field under the table.
The structure of the field in question is like this:
myFields
> group1
>>group2(repeating)
>>>field7(so, within the repeating table - group2 - there is a field - field7 - that I want to concatenate the output of.)
I am using the following forumla (in XPath mode) to try and acheive this:
xdMath:Eval(xdMath:Eval(../my:group1/my:group2, 'concat(../my:group2/my:field7, "; ")'), "..")
While the formula returns no errors, it doesn't seem to be working; it simply outputs the first instance of field7 each time.
(i.e. no matter how many different values appear in field7 throughout the repeating table, it consistently and constantly outputs only the very first value, albeit the correct number of times. So, for example, if there were 4 rows in the repeating table, (say, "blue", "red", "green" and "yellow") the field that is showing the nested eval output would just print "blue; blue; blue; blue; ")
Does anyone know why?
- Edited by _AJ_TUS_ Monday, April 30, 2012 1:53 PM
Monday, April 30, 2012 1:51 PM
Answers
-
Hi,
try this:
xdMath:Eval(xdMath:Eval(../my:group1/my:group2, 'concat(my:field7, "; ")'), "..")
Regards.
Tomás González. Twitter://@tgmourino
- Edited by Tomás González Monday, April 30, 2012 2:32 PM
- Marked as answer by _AJ_TUS_ Monday, April 30, 2012 2:34 PM
Monday, April 30, 2012 2:32 PM
All replies
-
Hi,
try this:
xdMath:Eval(xdMath:Eval(../my:group1/my:group2, 'concat(my:field7, "; ")'), "..")
Regards.
Tomás González. Twitter://@tgmourino
- Edited by Tomás González Monday, April 30, 2012 2:32 PM
- Marked as answer by _AJ_TUS_ Monday, April 30, 2012 2:34 PM
Monday, April 30, 2012 2:32 PM -
Fantastic, thank you Tomás! Didn't notcie that! :)Monday, April 30, 2012 2:35 PM
-
You're welcome! ;-)
Tomás González. Twitter://@tgmourino
Monday, April 30, 2012 2:37 PM -
Hi
I have tried the same this but it concats only the first row.
xdMath:Eval(xdMath:Eval(User, "concat(Login, '; ')"), "..")
when I try ../my etc the I get and invalid type error. The above works but it just evals the first row.
The data is a secondary data source.
Regards
Friday, January 17, 2014 1:33 AM