hinesdev
Nintex Newbie

Getting data out of a Nested Repeating Section

Jump to solution

I need help parsing the data out of a nested repeating section.  I have an expense report form/workflow that I have created.  In it I am trying to allow for a user to allocate a receipt.  The Allocation details are in the nested repeating section. 

All of my fields are labeled.  I can see them when I do a dump of the xml into a multi-line text field.

As I process through the steps to use the XML data, I can see the data from the first part of the repeating section, but not the nested section.

If I try to use the fn-XmlDecode(TravelExpRepeatSectionXML) on the XML data before parsing through the XML data, it looks at my data and only sees one Item rather than 2.

Will someone please help me to parse through the XML so that I can export the data into useable items.

Thank you!

0 Kudos
Reply
11 Replies
janeyres
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Hi Rebecca,

The nested repeating section will be in the xml but it's encoded so you'll need to manipulate the xml it so it's in a valid format.

If you name your repeating section controls you'll find it easier to find the nested one, I've named the nested control rptTwo in my test version.

In my test version I had to replace the following:

  1. > replaced with >
  2. &amp;lt; replaced with <
  3. &amp;quot; replaced with "
  4. In addition you'll need to remove the duplicate <?xml version="1.0" encoding="utf-8"?> tag you'll then end up with.

So from this...

I've ended up with this...

Hope that helps but if you need any more detailed info please let me know.

Jan

0 Kudos
Reply
hinesdev
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Jan,

Thank you for your response.  I have been able to perform steps 1-4 that you provided; however I am still not able to retrieve the data from the nested repeating section.  The last piece that you show, I am not able to do with the Query XML action.  I get an error parsing xml: invalid at the top level of the document.

Thanks!

Reply
janeyres
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Hi,

Please can you attach a file with the xml you're trying to parse?

Thanks

Jan

0 Kudos
Reply
Not applicable

Re: Getting data out of a Nested Repeating Section

Jump to solution

Hi Rebecca,

Even I was facing the same issue. Please refer to this thread(though it's lengthy it does the job) Extract data from text column

0 Kudos
Reply
hinesdev
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Jan,

Here is the original XML before I do any manipulation to it:

---------

<Item><TravelDate
type="System.DateTime">02/02/2016
00:00:00</TravelDate><TravelPlace type="System.String">test</TravelPlace><TravelAcct
type="System.String">7</TravelAcct><TravelAllocate
type="System.String">Yes</TravelAllocate><TravelBB
type="System.Boolean">False</TravelBB><TravelCostCenter
/><TravelSubLedger /><TravelAmt
type="System.String">100</TravelAmt><TravelAlloc100Percent
type="System.Int32">100</TravelAlloc100Percent><TravelAllocRepeat
type="System.String">&lt;?xml version="1.0"
encoding="utf-8"?&gt;&lt;RepeaterData&gt;&lt;Version
/&gt;&lt;Items&gt;&lt;Item&gt;&lt;TravelAllocPercent
type="System.Int32"&gt;30&lt;/TravelAllocPercent&gt;&lt;TravelAllocBillComments
type="System.String"&gt;&lt;/TravelAllocBillComments&gt;&lt;TravelAllocBB
type="System.Boolean"&gt;True&lt;/TravelAllocBB&gt;&lt;TravelAllocCostCenter
type="System.String"&gt;3&lt;/TravelAllocCostCenter&gt;&lt;TravelAllocSubLedger
type="System.String"&gt;59&lt;/TravelAllocSubLedger&gt;&lt;TravelAllocAmt
type="System.Decimal"&gt;30.00&lt;/TravelAllocAmt&gt;&lt;/Item&gt;&lt;Item&gt;&lt;TravelAllocPercent
type="System.Int32"&gt;30&lt;/TravelAllocPercent&gt;&lt;TravelAllocBillComments
type="System.String"&gt;&lt;/TravelAllocBillComments&gt;&lt;TravelAllocBB
type="System.Boolean"&gt;False&lt;/TravelAllocBB&gt;&lt;TravelAllocCostCenter
/&gt;&lt;TravelAllocSubLedger /&gt;&lt;TravelAllocAmt
type="System.Decimal"&gt;30.00&lt;/TravelAllocAmt&gt;&lt;/Item&gt;&lt;Item&gt;&lt;TravelAllocPercent
type="System.Int32"&gt;40&lt;/TravelAllocPercent&gt;&lt;TravelAllocBillComments
type="System.String"&gt;&lt;/TravelAllocBillComments&gt;&lt;TravelAllocBB
type="System.Boolean"&gt;False&lt;/TravelAllocBB&gt;&lt;TravelAllocCostCenter
/&gt;&lt;TravelAllocSubLedger /&gt;&lt;TravelAllocAmt
type="System.Decimal"&gt;40.00&lt;/TravelAllocAmt&gt;&lt;/Item&gt;&lt;/Items&gt;&lt;/RepeaterData&gt;</TravelAllocRepeat></Item>

----------

Here is the XML after I do the manipulation to it

---------

<Item><TravelDate
type="System.DateTime">02/02/2016
00:00:00</TravelDate><TravelPlace
type="System.String">test</TravelPlace><TravelAcct
type="System.String">7</TravelAcct><TravelAllocate
type="System.String">Yes</TravelAllocate><TravelBB
type="System.Boolean">False</TravelBB><TravelCostCenter
/><TravelSubLedger /><TravelAmt
type="System.String">100</TravelAmt><TravelAlloc100Percent
type="System.Int32">100</TravelAlloc100Percent><TravelAllocRepeat
type="System.String"><RepeaterData><Version
/><Items><Item><TravelAllocPercent
type="System.Int32">30</TravelAllocPercent><TravelAllocBillComments
type="System.String"></TravelAllocBillComments><TravelAllocBB
type="System.Boolean">True</TravelAllocBB><TravelAllocCostCenter
type="System.String">3</TravelAllocCostCenter><TravelAllocSubLedger
type="System.String">59</TravelAllocSubLedger><TravelAllocAmt
type="System.Decimal">30.00</TravelAllocAmt></Item><Item><TravelAllocPercent
type="System.Int32">30</TravelAllocPercent><TravelAllocBillComments
type="System.String"></TravelAllocBillComments><TravelAllocBB
type="System.Boolean">False</TravelAllocBB><TravelAllocCostCenter
/><TravelAllocSubLedger /><TravelAllocAmt
type="System.Decimal">30.00</TravelAllocAmt></Item><Item><TravelAllocPercent
type="System.Int32">40</TravelAllocPercent><TravelAllocBillComments
type="System.String"></TravelAllocBillComments><TravelAllocBB
type="System.Boolean">False</TravelAllocBB><TravelAllocCostCenter
/><TravelAllocSubLedger /><TravelAllocAmt
type="System.Decimal">40.00</TravelAllocAmt></Item></Items></RepeaterData></TravelAllocRepeat></Item>

------------------

Any help is appreciated.

Thanks!

Reply
janeyres
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Hi,

I think you've got it right. If I use the Query XML action on your after XML I get this.

So to get the nested repeater info for the TravelAllocPercent for example you can use the following which loads the data into a collection which you can then query.

Hope that helps but let me know if you need any more/different info!

Jan

Reply
hinesdev
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Am I missing something silly?  When I try to look at the tree view in the XML builder,  I am wondering if this is also related to why I am having issues parsing the data.

errorMsg.jpg

Thanks!

0 Kudos
Reply
janeyres
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

Hi,

So if you parse the following XML:-

<Item><TravelDate

type="System.DateTime">02/02/2016

00:00:00</TravelDate><TravelPlace

type="System.String">test</TravelPlace><TravelAcct

type="System.String">7</TravelAcct><TravelAllocate

type="System.String">Yes</TravelAllocate><TravelBB

type="System.Boolean">False</TravelBB><TravelCostCenter

/><TravelSubLedger /><TravelAmt

type="System.String">100</TravelAmt><TravelAlloc100Percent

type="System.Int32">100</TravelAlloc100Percent><TravelAllocRepeat

type="System.String"><RepeaterData><Version

/><Items><Item><TravelAllocPercent

type="System.Int32">30</TravelAllocPercent><TravelAllocBillComments

type="System.String"></TravelAllocBillComments><TravelAllocBB

type="System.Boolean">True</TravelAllocBB><TravelAllocCostCenter

type="System.String">3</TravelAllocCostCenter><TravelAllocSubLedger

type="System.String">59</TravelAllocSubLedger><TravelAllocAmt

type="System.Decimal">30.00</TravelAllocAmt></Item><Item><TravelAllocPercent

type="System.Int32">30</TravelAllocPercent><TravelAllocBillComments

type="System.String"></TravelAllocBillComments><TravelAllocBB

type="System.Boolean">False</TravelAllocBB><TravelAllocCostCenter

/><TravelAllocSubLedger /><TravelAllocAmt

type="System.Decimal">30.00</TravelAllocAmt></Item><Item><TravelAllocPercent

type="System.Int32">40</TravelAllocPercent><TravelAllocBillComments

type="System.String"></TravelAllocBillComments><TravelAllocBB

type="System.Boolean">False</TravelAllocBB><TravelAllocCostCenter

/><TravelAllocSubLedger /><TravelAllocAmt

type="System.Decimal">40.00</TravelAllocAmt></Item></Items></RepeaterData></TravelAllocRepeat></Item>

using the Query XML action like this:

Do you get an error in the XPath Builder?

Thanks

Jan

0 Kudos
Reply
hinesdev
Nintex Newbie

Re: Getting data out of a Nested Repeating Section

Jump to solution

No.  That works!  But I can't expand on the repeating section.

treeView.jpg

0 Kudos
Reply