Over a year ago, I had a need to have a workflow update/append text to a Multiple Lines of Text field. I figured out one way to do it, based on having a MLoT field that was set to Enhanced rich text. Then I completely forgot to blog about it. This came up again in a question I had recently. After trying to figure it out, I found my solution from last year. Better late than never right? Speaking of which, if you haven't seen this, check it out.. it's great - Better Late than Never.
I do want preempt this, that because we are dealing with Enhanced rich text, the structure of it may be different when you have entered data into your field.
Here's an example of an item with text in that field:
When running the workflow I have, the first thing I do is log the value of that field to the workflow history.
This is what the data looks like in that field:
As you can see, the internal structure is HTML (xml). So adding new rows, is as simple as adding a <p> node with the data in it.
We can start off with storing the current value of a MLoT field into a MLoT variable.
Next, we want to add one piece of text and append it to the end, but on a new line.
Here, we are using an Update XML action, and performing an Add child node, and adding a <p> html node.
Finally, the result is stored in a Multiple Lines of Text variable and then we use an Update Item action to update that MLoT field.
I hope this helps some of you. I don't have a download for this example, because I believe that everyone will have slightly different data in their MLoT field, so you'll need to tweak the workflow to cater for that.
But this will at least give you an idea of what to look for if you need this.