Hello, I've got a calculated value in a repeated section that looks up the serial number of an item from one of the lists in the site. However, I want to save this calculated value to a field but ... I can't see how it can be done. Can anyone help? Many thanks
Solved! Go to Solution.
The data for everything in the repeating section will be stored in the FormData, and can be retrieved using a workflow to parse the Form XML (you can store the entire repeating section to a Multiline text field as well for a quicker reference). For retrieving this information and storing it elsewhere, @jesse_mchargue and @eharris04 have some good blog posts on querying repeating section XML. See the links below for more info.
Hello, thank you so much for replying to me. That sounds like I will have to save the document and run a workflow before I can parse the XML - is that correct? I really wanted the calculated value to appear on new documents before they had been saved. Is that not possible?
Sorry, what I meant to say was that I wanted to calculate the values and then save them to a field as the document is saved for the first time.
@alice_oneill because you are using a repeating section, this would still require parsing the XML to get that value out. It is possible to do this before storing it in a document. Essentially you would have the user complete the form and see the values in the form.
Then you would use a workflow to parse the data and pull out the calculated control values. From there you can either store that back into SharePoint using the update list item action or you can use that in the workflow along with the document generation action to push the values into a document.
I may be misunderstanding what you mean by "document" but my interpretation of this was an actual document and not a form.
I have finally found a very convoluted way around the issue by parsing the XML and then running a site workflow to extract and update the relevant items. I've had to re-think how the whole thing works and just avoid the issue in the original question. And my apologies - I meant a list item rather than an actual document.