Skip to main content

Hi,

I am trying to parse the data below in the format of

Contact1, Location1, Date1, duration1; Contact2, Location2, Date2, duration2;....

but Date is always coming up as "1/01/0001 10:00:00 AM".

Could you please advise how to get date and Time format?

 

Also, when parsing the data I am getting Index always Zero. 

 

 

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version>1.0</Version><Items><Item><_9cd950de4572db3aaeb9c9301aac2d71 type="System.String">Contact1</_9cd950de4572db3aaeb9c9301aac2d71><_3917da977082051ae09cee6b45db4074 type="System.String">Location1</_3917da977082051ae09cee6b45db4074><_7987e51f3e133db808a902f687b2e29b type="System.DateTime">2020-05-23T14:00:00.000Z</_7987e51f3e133db808a902f687b2e29b><_97c8b99a40a018c8d05408893b87f1da type="System.String">10</_97c8b99a40a018c8d05408893b87f1da></Item><Item><_9cd950de4572db3aaeb9c9301aac2d71 type="System.String">Contact1.1</_9cd950de4572db3aaeb9c9301aac2d71><_3917da977082051ae09cee6b45db4074 type="System.String">Location1.1</_3917da977082051ae09cee6b45db4074><_7987e51f3e133db808a902f687b2e29b type="System.DateTime">2020-05-12T04:44:00.000Z</_7987e51f3e133db808a902f687b2e29b><_97c8b99a40a018c8d05408893b87f1da type="System.String">101</_97c8b99a40a018c8d05408893b87f1da></Item></Items></RepeaterData>

 

HI,

To iterate through all items you have to configure your xpath correctly.
To get the first part from item one the xpath would look like
/RepeaterData/Items/Item[1]/_9cd950de4572db3aaeb9c9301aac2d71
To get the first part of item 2 the xpath would look like
/RepeaterData/Items/Item[2]/_9cd950de4572db3aaeb9c9301aac2d7
You can use a variable in a loop that increases this number for you so it would look like:
/RepeaterData/Items/Item[{WorkflowVariable:ItemNumber}]/_9cd950de4572db3aaeb9c9301aac2d71

To work out where the date format issue is comming from use log in history actions.
First log the output of the query xml collection variable to see what it contains.
Then log the Get Item from collection variable If they are different then something has gone wrong in between.
If they are the same then there is something wrong with the query and you are just ending up with a default date and the query itself has not worked.

Reply