
I followed Reza Dorrani Video for "Power Automate SharePoint Item Modified flow | Track Column Changes"
https://www.youtube.com/watch?v=Ek4oYWPWfT0
and I was able to get Previous version, current version history values of all updated column values for a particular item except for a Choice column that allows multiple selections. Can you help me on how to get previous, current version values of a choice column that allows multiple selection?
Basically what he is doing in that video is:
-> When an item or a file is modified
-> Get Changes for an item or a file (properties only) since previous version using
Append to array variable
Name: varValues
Value: {
"Column": "@{item()}",
"PreviousValue": "@{coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[1]?[item()],'')}",
"CurrentValue": @{coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()],'')}
}
Append to array variable 2
Name: varHTML
Value: Column <b> @{items('Apply_to_each_varValues')?['Column']} </b>has updated from <b style='color:red'>@{items('Apply_to_each_varValues')?['PreviousValue']}</b> to <b style='color:green'> @{items('Apply_to_each_varValues')?['CurrentValue']}</b>
-> Send an HTTP Request to SharePoint
Body:
{
"properties":
{
"To":{"results":["@{triggerOutputs()?['body/Editor/Email']}"]},
"Subject":"Item Updated : @{triggerOutputs()?['body/Title']}",
"Body":"<h2 style='font-weight: 1000'>Track Changes </h2><br>
@{join(variables('varHTML'),'<br>')}
<br><br/><a href='@{triggerOutputs()?['body/{Link}']}'>Open Item</a>
<br><br>
<a href='https:abc.com/_layouts/15/Versions.aspx?
ID=@{triggerOutputs()?['body/ID']}&IsDlg=1&list=
abclistID'>Version History</a>"
}
}
Added all the pictures in the same order. I would appreciate your guidance on this
TIA!
TIA!
Hi @Anonymous,
One of the community members @tom_riha has written a blog about this subject. I would suggest to have a look at that blog.
In that blog he shows how you can use xpath with a text() function for this.
https://tomriha.com/get-previous-values-of-sp-multiple-selection-columns-in-power-automate/
I can also recommend his original post about retrieving previous values from the version history:
https://tomriha.com/get-previous-values-of-modified-sharepoint-columns-in-power-automate/