CopyRichText not removing HTML - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

CopyRichText not removing HTML

Last post 03-23-2016 11:10 AM by Hilary Stoupa. 21 replies.
Page 2 of 2 (22 items) < Previous 1 2
Sort Posts: Previous Next
  • 03-22-2016 03:09 PM In reply to

    Re: CopyRichText not removing HTML

    Can you attach your form in a reply again so I can see what you are doing?
    Hilary Stoupa

  • 03-23-2016 06:23 AM In reply to

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

     Attached is the form, at first I had hand typed in the concat function, then used the fx button.  Since all my errors came from any formula that pointed to items in quotes, I played around with using fields to supply to filters.  Then reverted to just trying one filter, to see if I could get that to work. 

     

    Attached is my form, plus a screenshot of the error I was getting for quote. 

     Screen shot of error:  https://drive.google.com/file/d/0B4aMjDV14cTUWUN6WTAwZndLUHM/view?usp=sharing


    Maria V
  • 03-23-2016 08:11 AM In reply to

    Re: CopyRichText not removing HTML

     Okay - for your latest form that was attached, I think the only issue you had was missing a space before the /xpathdest parameter.

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

    Concat formulas must be entered in the formula editor. If you need the end string to have quotes in it, like surrounding text in an XPath filter, you can use single quotes.

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

    You can always test your syntax by directly entering the string you hope to create from your concat formula into the command field and tabbing out (after putting that field on the form, of course) - and the Execution History shows you the command that was run, so after your rule runs, you can go verify that the syntax is what you expected.

    EDITED TO ADD: On March 31, 2016, I'm presenting our free weekly webinar with qRules 101 as the topic - you seem to be getting the hang of it just fine, but you may want to attend just in case there is any new info that would be helpful? http://www.qdabra.com/en/training/FreeWebinar.aspx 

    Hilary Stoupa

  • 03-23-2016 10:01 AM In reply to

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

    Re: CopyRichText not removing HTML

    Thanks, I did sign up for the Webinar.


    Both formulas came back with the same error below: 

     

    Action: CopyRichText. Arguments:   dsnamesrc: Receive_Forms
      xpathsrc: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:OPS_x0020_Highlights[../d:Report_x0020_Period = 'May 2016
      xpathdest: /my:myFields/my:CC_Highlights
    . Details: This is an unclosed string.. Stack:    at MS.Internal.Xml.XPath.XPathScanner.ScanString()
       at MS.Internal.Xml.XPath.XPathScanner.NextLex()
       at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseExpresion(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParsePredicate(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseStep(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseLocationPath(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseAdditiveExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseExpresion(AstNode qyInput)
       at MS.Internal.Xml.XPath.XPathParser.ParseXPathExpresion(String xpathExpresion)
       at System.Xml.XPath.XPathExpression.Compile(String xpath, IXmlNamespaceResolver nsResolver)
       at System.Xml.XPath.XPathNavigator.SelectSingleNode(String xpath, IXmlNamespaceResolver resolver)
       at Qdabra.Tools.RulesLibrary.Commands.GetValidNode(XPathNavigator start, String xpath, String errorMessage)
       at Qdabra.Tools.RulesLibrary.Commands.CopyRichText()
       at Qdabra.Tools.RulesLibrary.Commands.RunCommand(String commandName)
       at Qdabra.Tools.RulesLibrary.Commands.ExecuteCommand() 

    Maria V
  • 03-23-2016 10:18 AM In reply to

    Re: CopyRichText not removing HTML

     I didn't see the missing single quote, thanks! It is hard to see, but you can see there is a single quote before the closing double quote after the = sign. We need one on either side. See how the error message returns the xpathsrc, and we have a single quote on one side of May 2016? Oh! and we are missing a closing bracket too!

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


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

    Hilary Stoupa

    Filed under:
  • 03-23-2016 11:05 AM In reply to

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

    Re: CopyRichText not removing HTML

     OMG Hilary, Please let me buy you a big basket of chocolates!!!!   I did have to add a 'Query Receive_Forms' rule right before the QRules command line, but it finally worked!!!!  And you had the patience of a Saint!!!!

     

     

    Maria V
  • 03-23-2016 11:10 AM In reply to

    Re: CopyRichText not removing HTML

    Hey, this stuff has a learning curve - you are doing great & I'm glad you got it. :) Hope you can make the webinar next week - this thread has given me some good ideas for things to cover, so you have helped me as well.
    Hilary Stoupa

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