0

This has probably been asked before, and is likely either absurdly easy (and I'm missing it), or insanely complicated. But here goes:

Environment: SHAREPOINT ONLINE

Task: Create a workflow to send an email whenever a list item is changed. The email to contain who did it, when they did it, and the old and new values of whichever fields were changed.

So far, the workflow on edit is in and runs when the line item changes. But I can;t see anything to tell me which fields changed, so it's just sending some best-guess fields. I could, I suppose, put in duplicate fields to hold current values and do a set of comparisons ('If CURRENT_VALUE_FIELD =/= OLD_VALUE_FIELD then add to email and write CURRENT_VALUE_FIELD to OLD_VALUE_FIELD' as a pseudo code example), but there are a lot of fields. Is there any easier way? Target is:

Email to: Fred; Jane

Subject: Tracking list item (unique reference field) changed by (who changed it)

Unique record ID: (unique reference field)

Who changed it: (who changed it name)

When changed: (edit date/ time)

Changed fields:

(Field name) Old value: (stuff), New value: (other stuff)

(Field name) Old value: (stuff), New value: (other stuff)

(Field name) Old value: (stuff), New value: (other stuff)

(Field name) Old value: (stuff), New value: (other stuff)

New contributor
Peladon is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • That is effectively what you have to do. SharePoint does not track changes to specific fields, so if you want to know, you usually have to have your own hidden fields with the "old" value that you copy to in the same workflow that is checking whether it changed. Depending on which workflow technology you are using, if you have version history turned on for the list, you could use the REST api to grab the previous version of the item and compare old value with new value without needing duplicated fields, but you'd still have to compare field-by-field yourself. – willman Mar 23 at 17:51
1

SharePoint Workflow has no Out of box approach to get previous value of fields. After you change the item, trigger the workflow, we can only get the edited value. Rest api is an option to get version history.

However, have you tried the alert? It will send you an email displaying the edited fields, previous value and edited value like the samples below: enter image description here If you set the alert to be sent immediately, you can simply treat the time receiving the email as when the item is modified(There may be several minutes delay of triggering the alert.).The only thing alert cannot do is telling you who changed the item. For that, you can use an additional workflow to tell this. It may be a bit annoying when receiving a bunch of emails and need to find the two email talking about the same item. But it might be the easiest way to do this.

Your Answer

Peladon is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.