locked
Rich text formatting getting lost. RRS feed

  • Question

  • Hello again MSDN,

     

    I'm wondering if there is any solution to the following issue I'm running into.

    I have an infopath form for submitting data from a RichText field to a SharePoint list which then triggers a SPD2007 workflow to send an e-mail to specific groups. The issue is that the e-mail loses the line-breaks and bullets entered into the Infopath form. Is it possible to use the same text formatting that is in the form in a SPD2007 e-mail?

    Any solution would be greatly appretiated.

     

    Cheers DWTK

    Tuesday, May 3, 2011 4:09 PM

Answers

All replies

  • Are you sure the email loses the formatting?  Is the formatting getting to the form library?  Unless you've done some special trick, then that field was promoted as a single line of text with no formatting and only the first 255 characters.  Did you check that first?  The SPD workflow can send formatted text from rich text fields, but InfoPath isn't able to send rich text from itself to the SharePoint column without some special customization.
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Wednesday, May 4, 2011 6:48 AM
  • Hello again Clayton,

     

    The Infopath browser-enabled form is promoting a Rich Text field (which promotes as plain text, i needed to do so that I could have an unlimited input) to the form library. In doing so it removes the bullet/numbering formatting but retains the carriage returns. I have the SPD workflow e-mail lookup that data for insert into the body of the e-mail where at that point it still has lost the bullet/numbering and now drops the carriage returns. By special customization do you mean code?

     

    DWTK

    Wednesday, May 4, 2011 4:19 PM
  • Well yeah, SPD can't see anything that's not in the SharePoint column.  If the data in that field has no formatting, then there is no reason to expect SPD to have formatting when it reads from that field, right?  Also, if that field is promoted as plain text, then it does not have unlimited length - it only stores the first 255 characters that come from the form.  Is that sufficient for your needs?

    No, there is a trick for creating a field in the form library first, then associating a promote field with it, then deleting that field and re-creating it as a rich text type.  I believe it's on Alec Pojidaev's blog.


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Thursday, May 5, 2011 12:19 AM
  • Thanks Clayton !I checked out Alec's blog, I couldn't see any solution to an issue like mine or similar. I did see the one i think you were refering to 'How to promote InfoPath field to the SharePoint link type field'. It's not that big of a deal. I actually have unlimited text being promoted (at least well more than 1000 characters). in the form the text box is set as rich text XHTML, wrap, left align, expand to show all text, When I promote the field it promotes as plain text (it seems to decide that for itself) to multiple line column. I really don't care about the bolding or any font formatting, I would like to retain the bullet/numbering formatting and especially the carriage returns. I can enter the numbers in manually, but that doesn't help all that much with no carriage returns as I'm sure you can imagine. I'll keep trying.

    Thanks again.

    DWTK

    Friday, May 6, 2011 3:03 PM
  • Yeah, I don't know how you got it to make a multiple line column - I've never actually seen that happen before - but nonetheless, it's plaintext, so there should be no expectation of formatting. 
    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Friday, May 6, 2011 11:16 PM
  • is only possible to keep the line feeds. you wil loose the formatting. How? Just change the column setting in Sharepoint: Allow unlimited length in document libraries: yes

    And then in de html that makes up your e-mail body: use the <pre> tag around the multiline text field.

    • Proposed as answer by Roelof Meijer Tuesday, May 14, 2013 1:00 PM
    Tuesday, May 14, 2013 12:59 PM
  • I agree with Clayton, there is no support of rich textbox in a library where InfoPath is published. Because InfoPath form supports rich text box but in the library it will be plain text. However, I have a solution for your problem. As you have workflow, using it, you can extract the InnerXML of the field which will give you the HTML tags. Create another multi line field and add the extract in the new field. Ex. 

    <html xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve"><p>this is default blue</p>
    <p style="color:red">this is changed to red​</p></html>

    Now you can use this field in your email to send mails, which will be able to interpret the html tags.

    hope this helps.

    Thanks.


    rajdeep

    • Proposed as answer by Rajdeep C Thursday, January 28, 2016 1:23 AM
    Thursday, January 28, 2016 1:16 AM