Retrieve the value of text field with append to text set

  • 30 September 2016
  • 4 replies
  • 4 views

Badge +3

Hi all,

I have a list with a multi line text box that has append text setting on, versioning is set up on the list.

I need to copy the list item over to a document library to create a word document from the fields. I know that SharePoint

stores this in the version history for the item. The values are not getting copied over to the source library. I tried retrieving the values using the get versions web service but it only appears to work on Doc/pages libraries and not lists. The soap returns the list id as oooo-oooooo etc. when run against a list. Is there a way to get the values of a multi line text field with append text setting on in a workflow?

Any help appreciated


4 replies

Badge +3

Hi, I have managed to use the 'GetVersionCollection'  web service and returned the following xml (see last screen-shot):

I then parsed the xml using, the below screen-shot, but it's only returning the latest value in the QueryAndRFINotes field.

How do I change the XPath syntax so it returns all the values in the versions/QueryandRFINotes field?

192881_pastedImage_1.png


<Versions xmlns="http://schemas.microsoft.com/sharepoint/soap/"><Version QueryAndRFINotes="testnote" Modified="2016-10-03T09:27:43Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="come on" Modified="2016-10-03T09:23:58Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="newnew" Modified="2016-10-03T09:20:53Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="test" Modified="2016-10-03T09:18:19Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="bo" Modified="2016-10-03T09:10:47Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="new" Modified="2016-10-03T08:58:57Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="hello" Modified="2016-10-03T08:48:12Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="new entry" Modified="2016-10-03T08:43:16Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="ANother test" Modified="2016-10-03T08:32:17Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="latest" Modified="2016-10-03T08:24:26Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="tEST" Modified="2016-10-03T08:18:33Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="New entry today 3rg 10th" Modified="2016-10-03T08:14:28Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="tEST" Modified="2016-10-03T08:10:43Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="hello nwq" Modified="2016-09-30T13:13:11Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="New Comments" Modified="2016-09-30T12:44:38Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="test" Modified="2016-09-30T12:39:20Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="new" Modified="2016-09-30T12:33:02Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="test" Modified="2016-09-30T12:30:21Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="My new comments" Modified="2016-09-30T12:21:56Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Comments" Modified="2016-09-30T12:20:00Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Some comments" Modified="2016-09-30T12:07:36Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Some notes" Modified="2016-09-30T11:38:56Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Some notes" Modified="2016-09-30T11:38:42Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Some notes" Modified="2016-09-30T11:38:25Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="Some new notes" Modified="2016-09-30T11:28:09Z" Editor="2;#Jones,, Darren,#i:0#.w|tcsOurdomaindjones,#Darren.Jones@ourdomain.com,#,#Jones,, Darren" /><Version QueryAndRFINotes="I have a query about this risk " Modified="2016-09-30T08:46:21Z" Editor="11;#Hopkins,, Adam,#i:0#.w|tcsOurdomainahopkins,#Adam.Hopkins@ourdomain.com,#,#Hopkins,, Adam" /></Versions>

Userlevel 6
Badge +12

Hello ‌ - 

Have you tried to store the results into a collection variable?

You can then use a loop to go through each record within the collection and do whatever action you need to.

Hope this helps!

Badge +3

Doh! Of course.  Yep. Got it now. Parsed the xml into a collection variable then added a for each loop targeting that variable. I then stored the outcome in a text variable. Last action in the loop was a build string with the stored  text variable in the ref area. On the next line underneath that  variable in thw ref area added a second multiline variable that I also specified as the outcome for the build string action so the results were appended. Works great.

Userlevel 6
Badge +12

Excellent! Glad you got it working!

I couldn't tell you how many times I have sat there and banged my head against the desk trying to do the same thing! We all need that extra set of eyes to look at the same problem from a different perspective to get through.

Glad I could help.

Be sure to mark your question as answered so that others can find the same answers quickly happy.png

Reply