CopyRichText - does not like my source - InfoPath Dev
in

InfoPath Dev

CopyRichText - does not like my source

Last post 02-11-2013 07:29 AM by bsieloff. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 02-08-2013 08:51 AM

    CopyRichText - does not like my source

    Hi,

    Trying to get copyrichtext to work, but perhaps I'm doing something incorrect.

    to test, setup button and told it set a fields value

    in the "Field" field I selected the secondary data connection "QdabraRules (Secondary) and selected "Command"

    and in the value I've placed

    CopyRichText /xpathsrc=/xml/rs:data/z:row/@ows_PublishingPageContent /xpathdest=/my:myFields/my:field4

     I keep getting an error that the source is incorrect, I then tried adding the switch: /dsnamesrc=owssvr_sub_folder   (which is my dataconnect that calls owssvr.dll), but this did not help.

    syntax issue?

    Filed under: ,
  • 02-08-2013 08:58 AM In reply to

    Re: CopyRichText - does not like my source

    Hi-

    You're right in using /dsnamesrc. What's the Error message returned after you've added /dsnamesrc to the command?

    If you right click on the node (@ows_PublishingPageContent), and select CopyXpath, what xpath do you get? (You can paste it here if you can.)

    Thanks.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 02-08-2013 09:16 AM In reply to

    Re: CopyRichText - does not like my source

     

    The source xpath is: /xml/rs:data/z:row/@ows_PublishingPageContent

     The CopyRichText command looks like

    CopyRichText/dsnamesrc = owssvr_sub_folder/xpathsrc = /xml/rs:data/z:row/@ows_PublishingPageContent /xpathdest=/my:myFields/my:field4

    The error is: "CopyRichText/dsnamesrc" does not point to a valid location path of a field or group

  • 02-08-2013 09:21 AM In reply to

    Re: CopyRichText - does not like my source

    You'll need a space between CopyRichText and /dsnamesrc

    Also, I don't think you need to click FX to enter this command. You can enter the command directly into the Value field of the rule.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 02-08-2013 11:43 AM In reply to

    Re: CopyRichText - does not like my source

    Hi Ernesto,

     When I clicked the "verify formula" it reformatted the command..

    anyway, I did reformat and put into value field but it did not do anything, so I stuck the qrules results and error box out there.  The data that I have has html tags and I wanted to render the text with formatting if possible in a new field (field4).

    Here is a sample.  my source text is above the results.

  • 02-08-2013 12:19 PM In reply to

    Re: CopyRichText - does not like my source

    Thanks. This seems to suggest /my:myFields/my:field4 is not a rich text field. Could we check whether it is?
    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 02-08-2013 12:41 PM In reply to

    Re: CopyRichText - does not like my source

    Hi Ernesto,

    The field that the data is in (field1), is a rich text field

     The data is from my secondary source in SharePoint

  • 02-08-2013 12:46 PM In reply to

    Re: CopyRichText - does not like my source

    If the form does not contain sensitive data, could you attach it to this forum post (via the Options tab), or email it to support at qdabra dot com? Thanks!
    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 02-08-2013 12:57 PM In reply to

    Re: CopyRichText - does not like my source

    I'm confused again. You are copying to field4 in your command, but in your screenshot showing the data type for field1.
    Hilary Stoupa

  • 02-08-2013 01:58 PM In reply to

    Re: CopyRichText - does not like my source

    <attached>
  • 02-08-2013 02:10 PM In reply to

    Re: CopyRichText - does not like my source

    oops, true.. I took a snapshot of the wrong field.  Field4 is a rich text field too.

  • 02-08-2013 02:14 PM In reply to

    Re: CopyRichText - does not like my source

    Yup - I grabbed your sample. I'm going to run this in debug real quick and see what's up - more soon.
    Hilary Stoupa

  • 02-08-2013 02:46 PM In reply to

    Re: CopyRichText - does not like my source

    The error occurs when we try to set the inner XML of the destination node to the inner XML of the source - my guess is going to be because actual rich text has tags and the string representation in your source data does not - I tried this with a different owssvr.dll data source with the same result. I'm afraid this is likely just not going to work.

    If you can use plain text, you might be able to use the ReplaceString function to try to clean up the text.

    Hilary Stoupa

  • 02-09-2013 04:52 PM In reply to

    Re: CopyRichText - does not like my source

    Hi Bob,

    Maybe you don't need to use Filter Owssvr. Maybe you can just use the DBXL Query SharePoint web method. That might give you the data in a format that can be copied into the field.

    Just wondering ....

    Patrick Halstead
    Project Manager at Qdabra
  • 02-11-2013 07:29 AM In reply to

    Re: CopyRichText - does not like my source

    No DBXL, but I think the replace string function will work.

     My replace string function reads as: ReplaceString /xpathsrc=/my:myFields/my:field6 /pattern=</?\w+((\s+\w+(\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)/?>

    Thanks to the regex post from Phil Haack to save me hours of working that out.

    Thank you Hilary, Ernesto & Patrick for your continued help and support.

    -B

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