CopyRichText not removing HTML - InfoPath Dev
in

InfoPath Dev

CopyRichText not removing HTML

Last post 03-23-2016 11:10 AM by Hilary Stoupa. 21 replies.
Page 1 of 2 (22 items) 1 2 Next >
Sort Posts: Previous Next
  • 03-18-2016 05:55 AM

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    CopyRichText not removing HTML

    First off, big fan of this site and I just recently downloaded the qrules demo... which I LOVE!

    I have been searching for days on how to fix this issue, so I apologize if it has already been asked, please know I have tried to find the answer and I could really use someone's expertise.  

    I have one IP form submitting Rich Text to a SP list, and it maintains all of the line breaks... thank god (1st headache gone).  But now I need a different IP form to pull that Rich Text back into a summary, based on a drop down field.  Everything is linked properly and I am able to pull in my information, however it still has the HTML tags.  I tried different sequencing of rules to try and apply the COPYRICHTEXT command, but it still shows HTML tags in the field.

    Below is the syntax I am using:

    CopyRichText /xpathsrc=/my:myFields/my:CC_Highlights /xpathdest=/my:myFields/my:tmpHolder
     

    Maria V
  • 03-18-2016 07:41 AM In reply to

    Re: CopyRichText not removing HTML

    So - the CC_Highlights field gets populated with another rule that sets the value to the list data - when that happens do you see HTML in the field? If you drag the Highlights field from the receive data connection onto your form, does it display correctly?
    Hilary Stoupa

  • 03-18-2016 12:44 PM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

     I do see the HTML and when I drag the "receive data connection" and it also shows HTML.

     

     

    Maria V
  • 03-18-2016 02:23 PM In reply to

    Re: CopyRichText not removing HTML

    Can you attach your screenshot under the Options tab in a reply? I just get a little black x image. I just added a list data connection in an InfoPath form to a list that has a column that is rich text (not enhanced rich text). When I preview, my rich text from the secondary data connection displays correctly. But I do see that in my list data connection, the data type on my field is XHTML. In yours, the data type is "NotePlainType" - what are the settings for the field in SharePoint? Maybe try Rich Text, and walk through the list data connection again?
    Hilary Stoupa

  • 03-18-2016 03:27 PM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

     Sure, sorry about that.


    Maria V
  • 03-19-2016 04:19 AM In reply to

    Re: CopyRichText not removing HTML

    What is the column setting in SharePoint? Did you try walking through the data connection to the list again to see if the data type changes to XHTML? I think it may be the data type in that secondary data source that is the root of the issue....
    Hilary Stoupa

  • 03-19-2016 01:09 PM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

     I tried recreating the connection, and I also checked the source columns.  I am still seeing HTML in the form.  In the end, all I am trying to accomplish is remove the HTML and add line breaks or paragraph breaks.  Is there something qrules that does this feature?

    Maria V
  • 03-20-2016 06:58 AM In reply to

    Re: CopyRichText not removing HTML

    The issue I see in your form vs. the form I created to test is that in my test form, the data type for the Rich Text column from the secondary data source is XHTML. That is what CopyRich text is going to work with - it copies the XHTML from one node to another. In your form, the Rich Text column from your secondary data source is NOT XHTML - it is something different. That's why I asked what the list settings are on your column.... for my test, I used the middle option of Rich Text in my SharePoint list.
    Hilary Stoupa

  • 03-20-2016 08:08 AM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    I reconfigured my connection so that it would recognize the field as XHTML, and it strips the HTML but I have no line breaks.   



    Maria V
  • 03-20-2016 08:28 AM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

    To clarify, I read on another post that on the submission form (the one that feeds the results into this form), the richtextbox needed be set as plain text in SP first ... then I should set up my connection in IP, after that I could go back into SP and swap it back to rich text. 

    I am not sure if this makes a difference or not?  

    My perfect scenario would be to pull all the matching SP list data that matches the report period, and each field displays as plain text, keeping the original paragraph/line breaks and tabs/indentations.

    Maria V
  • 03-20-2016 09:42 AM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

     Figured part of it out.  I was filtering the data first and pulling it into my form then trying to use the CopyRichText.  If I pull directly from the SP list to populate the field, it works beautifully. 

     

    Now my question is, can I use xpath statements in the command to determine which SP list item it retrieves back?  Below in bold, is what I would like to be able to add to the command line, I have already tried many variations but they all are cause nothing to be returned.

     

    CopyRichText /dsnamesrc=Receive_Forms /xpathsrc=

    /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:OPS_x0020_Highlights[../d:Report_x0020_Period = xdXDocument:get-DOM()/my:myFields/my:Report_Period and contains(../d:Corp_x0020_Sales, "Corp")] 

      /xpathdest=/my:myFields/my:CC_Highlights 


    Maria V
  • 03-21-2016 07:38 AM In reply to

    Re: CopyRichText not removing HTML

     Hi - I think you might want to try a concat here, since you are involving multiple data sources:

     concat("CopyRichText /dsnamesrc=Receive_Forms /xpathsrc=

    /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:OPS_x0020_Highlights[../d:Report_x0020_Period = '", Report_Period , "' and contains(../d:Corp_x0020_Sales, "Corp")] 

      /xpathdest=/my:myFields/my:CC_Highlights ")

    With Report Period from the main data source picked with the field picker, so it is passed in as a value. Do you have the qRules Error node or Execution History somewhere on your form so you can see any returned error messages while you are working on your form? I usually leave those on till I have the design work done, then either move them to a debug view, or just take them off the form. Makes the dev process easier. :) 

    Hilary Stoupa

  • 03-22-2016 01:20 PM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

     Sorry for the delay, we have Office 365 and I had to change my password... which meant none of my data connection worked for 24 hours until all the servers replicated. Ugh!

     I added the error field, and I love that idea, thanks!!  Below is the error I get from qRules

     

    "Invalid command specified: concat" 

    I have tried adjusting the syntax a few different ways, below was my last attempt. 

     concat("CopyRichText /dsnamesrc=Receive_Forms /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:OPS_x0020_Highlights[../d:Report_x0020_Period = '", /my:myFields/my:Report_Period, "' and contains(../d:Corp_x0020_Sales, "Corp")] /xpathdest=/my:myFields/my:CC_Highlights")

    Maria V
  • 03-22-2016 02:31 PM In reply to

    • Mariav
    • Not Ranked
    • Joined on 03-18-2016
    • Springfield, IL
    • Posts 12

    Re: CopyRichText not removing HTML

     If I take out all filters, except for report period, I get the following error....  Concat and CopyRichText don't seem to play nice together.

    Required parameter unspecified: xpathdest. Usage is:

    CopyRichText
            [/dsnamesrc=Data Source Name (Source)]
            /xpathsrc=XPath to Node (Source)
            [/dsnamedest=Data Source Name (Destination)]
            /xpathdest=XPath to Node (Destination) 

    Maria V
  • 03-22-2016 03:08 PM In reply to

    Re: CopyRichText not removing HTML

    The concat formula needs to go in the formula editor (click the fx button) not just in the value for the rule. :)
    Hilary Stoupa

Page 1 of 2 (22 items) 1 2 Next >
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.