web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get Previous version v...
Power Automate
Unanswered

Get Previous version values for Choice column that allows multiple selections

(0) ShareShare
ReportReport
Posted on by

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

Since: sub(decimal(triggerOutputs()?['body/{VersionNumber}']),1)
-> Get Previous values by using below
Select
From: split(replace(replace(string(outputs('Get_changes_for_an_item_or_a_file_(properties_only)')?['body/ColumnHasChanged']),'{',''),'}',''),',')
Mapped ColumnName: replace(split(item(),':')[0],'"','')
Value: split(item(),':')[1]
Filter Array
From: Output of Select
Value is equal to 'true'
Select Column Names
From: Body Attribute of Filter Array
Map: item()?['ColumnName']
Send an HTTP Request to SharePoint
Uri: _api/web/lists/GetByTitle('List Name')/items(@{triggerOutputs()?['body/ID']})/versions?
$filter=VersionLabel eq '@{sub(decimal(triggerOutputs()?['body/{VersionNumber}']),1)}'&$select=@{join(body('Select_Column_Names'),',')}
Apply to each
Output from Select Column Names

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()],'')}
}

Apply to each varValues
Output from varValues

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&amp;list=
abclistID'>Version History</a>"
}
}

 

Added all the pictures in the same order. I would appreciate your guidance on this

 

TIA!

 

TIA!C1.PNGC2.PNGC3.PNGC4.PNGC5.PNG

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,480 Most Valuable Professional on at

    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/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard