CopyRichText and Filtered Data - InfoPath Dev
in

InfoPath Dev

CopyRichText and Filtered Data

Last post 10-26-2012 08:12 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-25-2012 05:38 PM

    CopyRichText and Filtered Data

    Hi,

    I have a SP list called CommentList.  It has a rich text field called Comment.  I'm trying to display a record of the CommentList where the Category field matches txtCategory1.  Below is my command:

    concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Comment[", Category = txtCategory1, "] /xpathdest=/my:myFields/my:rtxtComment1")

    Here is the xpath command:

    concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Comment[", xdXDocument:GetDOM("CommentList")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Category = my:txtCategory1, "] /xpathdest=/my:myFields/my:rtxtComment1")

    I am getting an error: Failed to select the source node to copy from.

    What am I doing wrong?  Please help.

    Thanks.

  • 10-25-2012 06:29 PM In reply to

    Re: CopyRichText and Filtered Data

    I swear I'm not the only one who ever answers these posts - you must be getting tired of me by now.

    Okay, so what you are doing wrong is using the field picker when you should not be. Here's what your formula shoud look like (with edit XPath checked):

    concat("CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Comment[../d:Category ='",  my:txtCategory1, "'] /xpathdest=/my:myFields/my:rtxtComment1")

    The thing is, what the Command cares about is the text value you are setting it to. You can set another field to the same value you are setting Command to (or set your form to Filler and use a message box with a formula) to help you see what you are doing a bit better, the concat formulas have a bit of a learning curve.

    What I've done is change your formula so that inside the square bracket a relative path is used to get to Category (../d:Catagory) from d:Comment. Then, after the equal sign, before the regular quote, I added a single quote - same on the other side. What you want is a concat expression that evaluates to something like:

    CopyRichText /dsnamesrc=CommentList /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Comment[../d:Category ='SomeValue'] /xpathdest=/my:myFields/my:rtxtComment1

    Does that make sense?

    Hilary Stoupa

  • 10-25-2012 07:40 PM In reply to

    Re: CopyRichText and Filtered Data

    I'll never tire of you.  :) You help me work things out.  I sort of get what you mean.  I'll learn more as I use qRules more.

    Thanks heaps for your help.

  • 10-26-2012 08:12 AM In reply to

    Re: CopyRichText and Filtered Data

    There is a bit of a learning curve, as you no doubt have realized - and the enormous user guide can be a little off-putting...

    I am doing an online class in December for qRules - you can find more here - there is a sidebar on the right with the training schedule.

    A lot of times, it makes it easier to change your form to a filler form from browser form so you can use a message box and pop up whatever your formula you are using for the command evaluates to - sometimes that helps me see where my mistakes are. :-)

    Hilary Stoupa

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