There are infinite amount of ways how to screw things and usually one (or quite a few) how to make it correctly.
Probably you should have checked the original article on double evaluation:
Enclosed please find Infopath XSN template (file) in attachment to this post:
- Concatenate field from repeating section (double eval expression trick).xsn
for your case. I have inserted defaults to facilitate testing which you might want to delete
Note that formula is:
- eval(eval(group2; 'concat(my:DepartmentCode, " , ")'); "..")
- and upon Edit XPath expression (advanced) checkbox checked, it would appear as:
xdMath:Eval(xdMath:Eval(../my:group1/my:group2, 'concat(my:DepartmentCode, " , ")'), "..")
and, while
group2 is chosen through "Insert field or group..." button ("Insert Formula" (fx) dialog box), the my:DepartmentCode is typed/entered through keyboard.