Nintex Connect

The Official Community Site for Nintex Software Products, including Nintex Workflow 2007, 2010 and 2013; Nintex Workflow for Project Server 2010; Nintex Reporting 2008 and Nintex Analytics 2010; Nintex Forms 2010; Nintex Live and Nintex SmartLibrary.
Welcome to Nintex Connect Sign in | Join | Help
in Search

Infopath and Update XML

Last post 11-09-2012, 10:58 AM by fritvet. 1 replies.
Sort Posts: Previous Next
  •  04-03-2012, 10:34 AM 22467

    Infopath and Update XML

    Hi all,

    I'm using Nintex WF 2007 (11000). I have created an Infopath form which is published to a SharePoint 2007 library. All is working well, but I need to update the Infopath form with some data and have used the Update XML action.

    In principal, it is working correctly as the required data is updated in the InfoPath form, however, the Update XML action adds in an extra <enter> when the XML nodes do not contain any data, see the example below:

    This is the original form XML:

    my:Action><my:Actions>ActionXML1</my:Actions><my:ActionImportance></my:ActionImportance><my:Priority>(2) Normal</my:Priority><my:LinkToTask></my:LinkToTask></my:Action>

    When updating  <my:LinkToTask></my:LinkToTask> following is the result:

    <my:Action>
      <my:Actions>ActionXML1</my:Actions>
      <my:ActionImportance>
      </my:ActionImportance>
      <my:Priority>(2) Normal</my:Priority>
      <my:LinkToTask>Testing</my:LinkToTask>
    </my:Action>

    All seems to be OK, however, the bold one (<my:ActionImportance>) is causing the form not to open in the browser anymore. InfoPath Client is fine. Changing the <my:ActionImportance> to be on the same line will resolve it.

    I have a lot more optional fields in this form so the chance of them being empty is big.

    Any ideas how this could be overcome?

    Thanks

  •  11-09-2012, 10:58 AM 26209 in reply to 22467

    Re: Infopath and Update XML

    Hey Kojeeman

     I think the best solution to this problem is to add a regular expression step, insert the variable which containts the xml as input, and then i suggest you would use  ">.*?<" as regular expression (ofcourse without the quotes), and let them replace with nothing.
    This should remove all spaces, starting from each ">" to the nearest "<".

     good luck! ;)

    Filed under:
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems