Hi DmitryB,
It took a while to figure out, but this is actually pretty quick to set up with out-of-the-box Infopath 2010 functionality.
When you created the Muiltselect control, it should have been automatically bound to a Group (looks like a folder in myfields) and a Repeating Field (looks like a piece of paper with a blue arrow).
- Where you want to display your concatenation, create a Calculated Value control. This will prompt a window asking for the XPath.
- Click the fx button on this window. This opens a formula window.
- Click the "Insert Group or Field" button and select the Group associated with your control This is the key - if you select the Repeating Field, it will only display the first value in that field. The Group will display all values in that repeating field.
- Click OK. This sets the XPath to "my:GROUP_SELECTED"
- Click OK.
Now when you preview the form, this Calculated Value control will automatically concatenate each selection checked or unchecked in your Multiselect control. No need to manually refresh.
Note: If you want the options to be delimited by something, modify the Values in your multiselect control to contain that delimiter. This will not impact how the option displays in the multiselect control.
On my form, I manually entered values, so I can simply type the delimiter into the Multi-Select List Box Properties. For example:
Value Display Name
Option1; Option 1
Option 2; Option 2
Good luck!
Kim