0

I have such a scenario: When Item is edited on the list an email is sent with information about changes.

Current solution: We created an additional list called Archive that holds information only for comparison. We have a workflow that runs on edit and compares fields between the current version and the one on the Archive list. It generates an email with highlighted fields that changed (IF field 'not equal' field_archive). Then the workflow updates archive item for future changes.

Required changes: Currently, this comparison is only stating if anything has changed. We need to highlight exact changes for example: Field1: before change: This is a sample string. after change: This string has been changed. Information in email: This <strong>string has been changed</strong>

Field 2 checkboxes: before change: [x] checkbox1 [x] checkbox2 [ ] checkbox3

after change: [x] checkbox1 [ ] checkbox2 [x] checkbox3

info in email: checkbox1, <strong>checkbox3</strong>

What are the options when using workflows to achieve that - any other solution than sending fields to webservice?

2
  • This doesn't answer your question but... I suggest that instead of using two lists you just turn versioning on and then compare current version of the item against the previous version. Apr 17, 2019 at 12:24
  • Thank you @RobWindsor for the input. I haven't dig into versioning and by what information I have found I decided on the second list - I will definitely try that. Apr 17, 2019 at 22:48

1 Answer 1

0

The "Get changes for an item or a file (properties only)" action is something relatively new that I have used with success. This provides me fields that have changed.

Starting with the "When an item or a file is modified" action. I initialize 2 variables 1st is varID as an integer and value is set to the ID and the 2nd is an array to capture the values of items that have changed without any values. Then make an HTTP call to the RESTful API with the uri of "_api/web/lists/getbytitle('LISTNAME')/items(@{triggerOutputs()?['body/ID']})/Versions".

Then parsed the HTTP call output into JSON I then append the initialized Array Variable with the JSON values:

  1. List item Title,
  2. the version #1 (Current Version) of the List Item ,
  3. version #0 (Proposed version) of the List Item

by using this Value: { "Title": "Description",

"Current Value": "@{body('Get_OldVersionValues_JSON')?['d']?['results']?[1]?['Description']}",

"Proposed Value": "@{body('Get_OldVersionValues_JSON')?['d']?['results']?[0]?['Description']}" }

this example was to compare the latest 2 values of "Description" in my SharePoint list.

in the email I use the "create HTML table" with the Array variable and viola:

Description,
Create 3D PDF files from SP Review. Files can be viewed with Adobe Reader, & Creates 3D PDF files from SP Review. Files can be viewed with Adobe Reader.

I hope this helps someone.

Kev

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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