AnsweredAssumed Answered

Parsing RepeaterData using xpath - invalid text value error

Question asked by tlyne on Feb 13, 2015
Latest reply on Jun 19, 2015 by andrew.beals@nintex.com

I'm trialing Nintex for Office365 - almost everything works fine except I have a problem iterating through RepeaterData.

 

My test is quite simple:

 

  • I have a repeating region in a Nintex form (for a purchase order) tied to a SharePoint column holding purchase order details
  • My workflow is initiated on save
  • The WF reads the repeater data into a dictionary using Query XML (xpath query is "//Item", return outer xml)
  • A WF variable is set to the count of the dictionary items
  • A loop is setup to iterate over the dictionary contents (loops until a tmpCounter variable = the count of dictionary items)
  • Inside the loop the first step is to get the next dictionary item as a text WF variable (using Get Item From Dictionary and the counter WF variable in parenthesis as the key)
  • Use Query XML to get some node contents that are then concatenated to produce an HTML table

 

Normally this works OK, but occasionally I receive an "Invalid Text Value error" in the WF's internal status. However I can't see much difference in the actual XML contents where this problem occurs; for example this XML works fine:

 

<?xml version="1.0" encoding="UTF-8"?>
<RepeaterData>
    <Version />
    <Items>
        <Item>
            <Sku type="System.String">test4</Sku>
            <description type="System.String">test 35</description>
            <qty type="System.Double">1</qty>
            <price type="System.Decimal">1</price>
            <linetotal type="System.Decimal">1.00</linetotal>
        </Item>
        <Item>
            <Sku type="System.String">test4</Sku>
            <description type="System.String">test 4</description>
            <qty type="System.Double">1</qty>
            <price type="System.Decimal">1</price>
            <linetotal type="System.Decimal">1.00</linetotal>
        </Item>
        <Item>
            <Sku type="System.String">test4</Sku>
            <description type="System.String">test 7</description>
            <qty type="System.Double">1</qty>
            <price type="System.Decimal">1</price>
            <linetotal type="System.Decimal">1.00</linetotal>
        </Item>
        <Item>
            <Sku type="System.String">test4</Sku>
            <description type="System.String">test 56</description>
            <qty type="System.Double">1</qty>
            <price type="System.Decimal">1</price>
            <linetotal type="System.Decimal">1.00</linetotal>
        </Item>
    </Items>
</RepeaterData>


 

But this XML produces the error at the point of getting the first dictionary item using the counter WF variable:

 

<?xml version="1.0" encoding="utf-8"?>
<RepeaterData>
<Version />
<Items>
     <Item>
          <Sku type="System.String">test111111</Sku>
          <description type="System.String">test 2</description>
          <qty type="System.Double">1</qty>
          <price type="System.Decimal">1</price>
          <linetotal type="System.Decimal">1.00</linetotal>
     </Item>
     <Item>
          <Sku type="System.String">test222222</Sku>
          <description type="System.String">test 3</description>
          <qty type="System.Double">2</qty>
          <price type="System.Decimal">2</price>
          <linetotal type="System.Decimal">4.00</linetotal>
     </Item>
     <Item>
          <Sku type="System.String">test33333</Sku>
          <description type="System.String">test 4</description>
          <qty type="System.Double">3</qty>
          <price type="System.Decimal">3</price>
          <linetotal type="System.Decimal">9.00</linetotal>
          </Item>
     </Items>
</RepeaterData>

 

I'm not sure where to look next.

Outcomes