Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Track Column Changes Flow

(0) ShareShare
ReportReport
Posted on by 21

Hi everyone, I have got a flow that supposed to grab the previous column's values and track its changes. I followed the guide based on this video Power Automate SharePoint Item Modified flow | Track Column Changes (Version History) - YouTube.
My Send an HTTP Request to SharePoint action output is grabbing the results correctly of modified and

field_x005f_8 (see figure 1); however, when I get to Append to Array variable with my apply to each action
field_x005f_8 is blank (see figure 2) and Modified is showing (see figure 3). The expression I am using for the Value is 
coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()], '').  Can you please help?
 
Update: I noticed that the Send_an_HTTP_request_to_SharePoint action changes the field name of the Select - Column Names action from field_8 to field_x005f_8 (see figure 1 and 4), why is that? Select - Column Names action is before the Send_an_HTTP_request_to_SharePoint action.

 

mg1308_0-1694497881593.png

Figure 1 Send_an_HTTP_request_to_SharePoint

 

mg1308_1-1694498052092.png

Figure 2 Append To Array result 1

 

mg1308_2-1694498066217.png

Figure 3 Append To Array result 2

 

mg1308_0-1694502263734.png

Figure 4 Select - Column Names

 

 

Thanks!

 

  • Verified answer
    mg1308 Profile Picture
    21 on at
    Re: Track Column Changes Flow

    Hi I have fixed the issue i have just changed the select - column names action map section to replace(item()?['ColumnName'], 'field_''field_x005f_'). Instead of using a second Send an HTTP request to SharePoint. This seemed to work and pick up the previous changes. This works considering the field names in the select action has to match with Send an HTTP request to Sharepoint field names to show results.

    mg1308_0-1695005112388.png

     

  • mg1308 Profile Picture
    21 on at
    Re: Track Column Changes Flow

    Hi @Expiscornovus 

     

    Here is my expression for the first Send an HTTP request to SharePoint: 

    _api/web/lists/GetByTitle('Emp List')/items(@{triggerOutputs()?['body/ID']})/versions?$filter=VersionLabel eq '@{sub(decimal(triggerOutputs()?['body/{VersionNumber}']), 1)}' &$select=@{join(body('Select_-_Column_Names'), ',')}

     

    mg1308_0-1694651304950.png

     

     

    I did a sub expression to get the previous record.

  • Expiscornovus Profile Picture
    31,779 Most Valuable Professional on at
    Re: Track Column Changes Flow

    Hi @mg1308,

     

    Can you share a screenshot of the configuration of the Send an HTTP request to SharePoint action. Interested to see what Uri and Headers you are using in that action.

     

    I would expect this type of URI:

    _api/web/lists/getbytitle('Documents')/items(<itemid, for example 18>)/versions?$filter=VersionLabel eq '<versionlabel, for example 1.0>'&$select=@{join(body('Select_ColumnNames'),',')}

     

    versions_example.png

  • mg1308 Profile Picture
    21 on at
    Re: Track Column Changes Flow

    Hi @Expiscornovus 

    Thank you so much for your response! I was able to grab the correct name by creating another Send an HTTP request to SharePoint action named it as Send an HTTP request to SharePoint action - GetInternalName but my value part in my Append to variable is still blank, my expression is

    coalesce(body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']?[0]?[item()], ''). Please see screenshot below:

    mg1308_0-1694570804734.png

     

    Here is also a screenshot of my whole flow:

    mg1308_1-1694571318123.png

     

     

  • Expiscornovus Profile Picture
    31,779 Most Valuable Professional on at
    Re: Track Column Changes Flow

    Hi @mg1308,

     

    The underscore character gets encoded in the ColumnHasChanged array in the Get changes for an item or file action. So the _ in field_8 gets encoded to _x005f_ which makes it field_x005F_8

    (HEX 005F, https://www.w3schools.com/charsets/ref_utf_basic_latin.asp)

     

    In the below thread I tried to workaround that by using the internalname of the field instead:

    https://powerusers.microsoft.com/t5/Building-Flows/Expression-Not-Valid-Power-Automate-SharePoint-Item-Modified/m-p/1770536/highlight/true#M195765

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492