Hi
I am having some troubles trying to parse the XML data from a Nintex form repeater field (storing it in a list multitext plaintext field). Here is what the XML output from the field looks like:
<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><SystemID type="System.String">1</SystemID><SystemName type="System.String">Salesforce</SystemName><SystemAccessStatus type="System.String">Pending</SystemAccessStatus><SystemAccessDateActioned type="System.String"></SystemAccessDateActioned></Item><Item><SystemID type="System.String">2</SystemID><SystemName type="System.String">SharePoint</SystemName><SystemAccessStatus type="System.String">Pending</SystemAccessStatus><SystemAccessDateActioned type="System.String"></SystemAccessDateActioned></Item></Items></RepeaterData>
I am not sure why, but the version close tag is coming after the RepeaterData open tag and I believe this is why my XPATH query is not working:
/RepeaterData/Items/Item[SystemName={WorkflowVariable:UAR_SystemName}]/SystemAccessStatus
I basically need to update the SystemAccessStatus field (which is text field in the repeater on the form) with a value. It is currently not being updated.
I also need to update the SystemAccessDateActioned field as well with the date value from the task completed date:
/RepeaterData/Items/Item[SystemName={WorkflowVariable:UAR_SystemName}]/SystemAccessDateActioned
However, I believe neither of those XPATH queries would work as the XML output from the form itself is incorrect. Can someone please verify this?
Hi Krishant,
<Version /> is a specific tag of your RepeaterData which is auto-closing. It's equivalent to <Version></Version>.
This has nothing to do with <?xml version="1.0" encoding="utf-8"?>.
To your problem, quotes are missing around your variable in your XPath expression.
I think this following could try the trick :
/RepeaterData/Items/Item[SystemName="{WorkflowVariable:UAR_SystemName}"]/SystemAccessStatus
I tried that - that still didn't work. I put in a log for the "Store result in" field. That field is actually empty. Does this mean that the XML is not being updated?
I found the issue. It was really trivial actually, but the suggestion by Pierre did help. I was missing an additional '/' in the XPATH query. My complete query came out to be:
//RepeaterData/Items/Item[SystemName="{WorkflowVariable:UAR_SystemName}"]/SystemAccessStatus
This stored the result in a new variable. I also was updating my list item with the older variable and not the new updated xml.
Thanks.
I have encountered the same issue as you earlier this morning, solved by using Build String action to store the XPATH query as I think using references such as {WorkflowVariable:UAR_SystemName} confuses xml query action