FormData is being a jerk!


Userlevel 6
Badge +15

Hello friends.

I am no stranger to FormData. I have parsed many a repeating section. However ... for whatever reason .... the FormData in my current item is just.. nothing. Something is wacky. I have connected FormData to a multi-line column, I have added that column to the view ... nothing.

It's also no longer giving me back XML, it's giving me this kind of thing BEFORE it goes into the Forms Repeating Section UDA ( via Vadim Tabakman ) .... ("variablename" in place of all variables for censoring)

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><VariableNametype="System.Double">2222</VariableName><VariableName type="System.Double">2359</VariableName><VariableNametype="System.Double">6.1</VariableName><d3a775e7-2f2f-45f4-9b69-5c081ad273d0 /><VariableNametype="System.String">98.1</VariableName><VariableNametype="System.Double">20</VariableName><VariableNametype="System.Double">2265</VariableName><VariableNametype="System.Double">0.2</PercentOversizeDecimal><VariableNamewtype="System.Double">6.8</VariableName><VariableNametype="System.String">true</VariableName><VariableNametype="System.Int32">1</VariableName><VariableNametype="System.String">98</VariableName></Item></Items></RepeaterData>Sample ID: ID-123

And this kind of nonsense AFTER it comes back from the UDA...  (SEE FURTHER COMMENTS FOR MORE DETAILS & UPDATES)

222223596.198.12022650.26.8true198

The repeating section is named the same as it always has been

.. and it used to work. Nothing has really changed, I've checked variable names against this.. everything comes back blank or 0. 

I feel like I must be missing something REALLY stupid. What should I check?? Am I crazy, this SHOULD come back LOOKING like XML, right??

rhia


19 replies

Userlevel 6
Badge +15

You guys ever seen this before? 

Userlevel 5
Badge +14

this doesn't seem to be whole FormData XML, it looks like you already picked just repeater part out of it.

"Sample ID: ID-123" at the end of your sample doesn't belong to repeater data. it breaks validity of XML so that's likely the reason UDA do not provide expected results.

btw, it's better to create multiline text field(s) in list dedicated to (each) repeating section on list form...

Userlevel 6
Badge +15

Hi Marian - thank you - I do have a dedicated column ("FormData" - multiline) which I've connected the repeating section to. ...But nothing is there. Completely blank.

And, I agree with what you're saying in that it doesn't look like the whole FormData XML ... but that's what it's giving me before going into the UDA :S 

Userlevel 5
Badge +14

Hi Rhia Wieclawek‌,

first of all I would rename the column! (deleted & created new one to be extra sure column's internal name is not preserved)

there is already existing hidden FormData column. so it might happen sometime is updated one column and sometimes the other. that would explain those broken data.

Badge +10

It will be blank if the column created is multiline and it is not plain text

Badge +10

You can't connect the form data to a column. But you can update the column with FormData using workflow. So It should be the repeater control data that is connected to the column. Make the multiline column as plain text and try. Something went wrong with the QueryXMLData control.

Userlevel 6
Badge +15

Ah, good point, I've done this now - using XMLData - and I can update the column to have the data needed, which looks like the "BEFORE" in the original post. 

Userlevel 6
Badge +15

So after trying this on a new item, the UDA is running, and now I'm getting this:

Workflow Status

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><beada732-0784-4577-97fd-467e31954290 type="System.String">Test&amp;#160;Failed&amp;#160;-&amp;#160;Variable Name NWF.FormFiller.Functions.GetValue(&amp;#39;382522f

and it terminates there.

Well, at least I have something more pointed to investigate.

Userlevel 6
Badge +15

Okay I'm kind of working out loud here..

This is the fail point:

NWF.FormFiller.Functions.GetValue(&amp;amp;amp;#39;382522f3-e8e8-43a1-94cb-13c03e961a07&amp;amp;amp;#39;, sourceContext, &amp;amp;amp;#39;string&amp;amp;amp;#39;)&amp;lt;/beada732-0784-4577-97fd-467e31954290

 

Now I just have to figure out what ^ that is. :|

Userlevel 5
Badge +14

it looks like something is breaking syntax of javascript within a page...

some missing or extra coma, brace, apostrophe, backslah.... in script or rule?

or maybe not properly escaped data?

Userlevel 6
Badge +15

Thanks Marian, I'll take a look. There's no javascript in this form, but I'll check out the rules for sure.

Userlevel 6
Badge +15

Okay, I figured it out. 

I couldn't parse it out because there was only 1 section brought back. 

What we've (always) had is //Items/item/{numindex}/variable


It has, as far as I know, always worked.

Now, I've removed that {numindex} and it's working. 

Welp.

Userlevel 5
Badge +14

hm, what environment was is on with numindex?

I've never seen repeater XML structured like this

wasn't it something like

 //Items/item[numindex]/variable

that would make much more sense

Userlevel 6
Badge +15

I agree - this is in SP2013

And, I had to take out the numindex to make it work. Boggled my mind, never seen that before. ESPECIALLY since it was working perfectly previously with //Items/item{numindex}/variable

I don't get it. But. It's working for one off items.

Userlevel 6
Badge +15

Do you think this is something I should raise with support

Userlevel 5
Badge +14

I don't know.

are you able to provide example of such repeater XML and exact XPath expression?

you can remove data, it's enough to see XML structure.

Userlevel 6
Badge +15

Here's an example of some of the XML: 

 Workflow Status

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><VariableName type="System.Double">3942</VariableName><VariableName type="System.String">4.4</VariableName>

Here's an example of XML query that DOES NOT work: 

//Items/item[{WorkflowVariable:NumIndex}]/VariableName

(I've tried lower case and upper case I's on item, just in case)

And here's an example of XML query that DOES work:

//Items/item/VariableName

Now this is all well and fine if I only have one repeating item ... but... I need to loop through these stupid things. 

I'm totally perplexed, the way I'm doing it has always worked. And suddenly it is having a fit about my NumIndex - which, is a number variable, and is set correctly (I checked many many times).

I'll see if I can get the full XML block out.

Userlevel 5
Badge +14

Hi Rhia Wieclawek‌,

from my point of view, everything works correctly.

//Items/item/VariableName

returns all the elements with name 'VariableName' of all the items.

in your example there are two such elements. Note both of them are within the same <Item> element

//Items/item[{WorkflowVariable:NumIndex}]/VariableName

returns all the elements with name <VariableName> of the item selected by given NumIndex

as mentioned above, you have both <VariableName> nodes within one (first) <Item> element, so following returns all (both) the elements of name 'VariableName' of first <Item>

however. since you have only one <Item> node, following can not work - there is not second <Item> element

I guess you might be confused by following: if you had in the past just single occurrence of <VariableName> node within <Item> one, you might address <VariableName> of the 2nd <Item>, so following would work in that case.

this is as well typical case, I do not see too much sense to have two controls named the same within on repeater row.

Userlevel 6
Badge +15

Hmm, in reality, they aren't named the same - I should've said VariableName1 and VariableName2. 

I shouldn't say anything more till I get the full XML for a repeater with more than one section, I think my issue will be more easily seen. I appreciate you responding though Marian!!

Reply