Getting line breaks in a multi-line field customized by InfoPath…

I’ve been working on a site, and one of the fields in the list is a multi-line text box that collects concatenated values from entries on other fields. The underlying core of the site is that this is a custom list that I’m customizing with InfoPath.

I had been putting the different field concatenations one after the other, separated by semicolons. But ideally, it would be nice to have each set on a separate line.

My SharePointBuddy pointed me in the direction of this post: http://blogs.msdn.com/b/infopath/archive/2005/03/04/385577.aspx

It didn’t seem to work for me, but there was a comment in there that talked about actually copying and pasting a line break character in the concat statement in the rule. By creating a WordPad document that has two lines of content, you can copy the end of the first line and get the invisible line break character. Then when you paste it into the concat statement, you get your line breaks in the field!

Here’s how it looks in the rule:

20130826Image003

The line break in the concat statement isn’t a manual line break I put in there. It’s the effect of pasting in the line break character from the WordPad document. I also put some notes to that effect in a hidden section above the field so that future programmers wouldn’t “fix” the layout of that statement.

Before, here’s what my field looked like:

20130825Image001

With the linebreak copied in there, we now have this:

20130825Image002

MUCH better!

4 responses to “Getting line breaks in a multi-line field customized by InfoPath…

  1. Just gave this a shot in an edit history field on a form I’m working with, and it worked beautifully! Thanks Tom!

  2. On investigation, you can just use CTRL+ENTER in the xpath formula rather than copy and pasting. Brilliant!! thank you

  3. I’m currently have the same problem. I tried with CRTL+ENTER but it doesn’t work. Here’s my code:

    concat(“linebreak”,”linebreak”,field1,field2,”linebreak”,field3)

    I don’t khow how to create a XML file that contain a line break. Is there someone who have this answer? I would like to create a XML file and join this file with the data connection in infopath. is it possible ?

    Thanks

  4. Brilliant! No messing around with external xml files! A simple 10 second solution! Much appreciated!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s