cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hi,

 

in one workflow I use the Update XML action to fill out the field in the InfoPath form with the approvers comments. The Replace node contents option was selected , but the workflow errored with following subject: Error processing XML. Invalid Operation.

What's wrong? Should I use Set node text instead? What's the difference between these options? What to do if updated field has no value in the beggining?

 

Thanks for help!

/Yevgeny

Labels: (2)
Tags (1)
0 Kudos
Reply
5 Replies
Workflow Hero

Re: Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hello

Very old but not answered...

Is the problem still open?

For me this worked fine: If you have this workflow running on your infopath library, then you can use "Current item" as source. The XPath Builder works very fine at this point.

2014-10-18 10_55_32-Workflow Designer - Internet Explorer.png

0 Kudos
Reply
Not applicable

Re: Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hi Christian,

thanks for advise, but it doesn't work.

What did I find: in my particular case it is a date field. Empty date has a xsi:nill value. I can't replace this value for any normal date: Nintex adds new node instead. Don't know how to handle that.

/Yevgeny

0 Kudos
Reply
Workflow Hero

Re: Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hi Yevgeny!

I tried this with a date field and it also works. The xsi:nil disappeared after the workflow. Because it is no more nil.

Formular before workflow:

<my:meineFelder xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2014-10-18T09:33:26" xml:lang="de-at">

  <my:feld1 xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"></my:feld1>

</my:meineFelder>

Workflow:

2014-10-18 11_50_01-Workflow Designer - Internet Explorer.png

Formular after workflow:

<my:meineFelder xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2014-10-18T09:33:26" xml:lang="de-at">

  <my:feld1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">2014-10-17</my:feld1>

</my:meineFelder>

I think the error message has nothing to do with the field itself. Maybe your xml structure is not correct. Are using the correct XML source? Is the XPath correct? Is the date value correct you try to insert?

0 Kudos
Reply
Not applicable

Re: Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hi Christian,

The XML structure is correct, this is an InfoPath form.

Will try once again and get back to you.

Thank you very much for help!

/Yevgeny

Sent from iPad, sorry for possible typos.

0 Kudos
Reply
Workflow Hero

Re: Update XML action: Set node text vs Replace node contents. What's the difference?

Jump to solution

Hello,

 

You asked the difference between Replace node contents and Set Text and there in fact exists a very big difference.

 

Assume we have the following XML:

 

<?xml version="1.0"?>

<catalog>

   <book id="bk101">

   <author>Gambardella, Matthew</author>

   <title>XML Developer's Guide</title>

   <genre>Computer</genre>

   <price>44.95</price>

   <publish_date>2000-10-01</publish_date>

   <description>An in-depth look at creating applications

  with XML.</description>

   </book>

   <book id="bk102">

   <author>Ralls, Kim</author>

   <title>Midnight Rain</title>

   <genre>Fantasy</genre>

   <price>5.95</price>

   <publish_date>2000-12-16</publish_date>

   <description>A former architect battles corporate zombies,

  an evil sorceress, and her own childhood to become queen

  of the world.</description>

   </book>

</catalog>

 

If we used "Replace Node Contents" with a value of  <Test></Test>  your result would look like this:

 

<?xml version="1.0"?><catalog><Test></Test></catalog>

 

 

However, if we used Set Text option instead, your result would look like this:

 

<?xml version="1.0"?>

<catalog>

   <book id="bk101">

   <author>Gambardella, Matthew</author>

   <title>XML Developer's Guide</title>

   <genre>Computer</genre>

   <price>44.95</price>

   <publish_date>2000-10-01</publish_date>

   <description>An in-depth look at creating applications

  with XML.</description>

   </book>

   <book id="bk102">

   <author>Ralls, Kim</author>

   <title>Midnight Rain</title>

   <genre>Fantasy</genre>

   <price>5.95</price>

   <publish_date>2000-12-16</publish_date>

   <description>A former architect battles corporate zombies,

  an evil sorceress, and her own childhood to become queen

  of the world.</description>

   </book>

  &lt;Test&gt;&lt;/Test&gt;

</catalog>

 

 

Make sure you select the correct operation, because it'll have a huge impact on the result depending on what your XML looks like.

Thanks

Reply