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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get Check In Co...
Power Automate
Unanswered

How to get Check In Comments of all Versions

(0) ShareShare
ReportReport
Posted on by 4

Hi all,

 

I am very new to power automate, and am trying to create a flow which copies documents to a new library once their status is changed to a certain value. What I'm having trouble with is capturing the Check In Comments for each version. I've gone through this and other forums and found answers similar to those in the links below, however these just give me the same Check In Comment (the last one) against every version of the document (ie, if the last check in comment reads "final test", I'll get "final test" repeated for each version besides the 

"OData__x005f_CheckinComment" value in the outputs of the HTTP request. 
 
I also found people discussing using "getFileByServerRelativeUrl" in the 'Send an HTTP Request to SharePoint" action but I have no idea how to implement that or what the server relative URL is. 
 
If anyone can let me know how to the different Check In Comments for different document versions I would appreciate it!

 

https://powerusers.microsoft.com/t5/Building-Flows/Include-Comment-Version-History-in-email-sent-from-SharePoint/m-p/573335

https://powerusers.microsoft.com/t5/Building-Flows/SharePoint-How-to-get-Check-in-Comment/m-p/355684#M39472

 

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

    Hi @jesstaylor90,

     

    I think part of the solution is in your first link. However, with that approach you can only retrieve the latest check-in comment. If you want to retrieve the other check-in comments you can use the File Version method

     

    With that method you can retrieve the historical check-in comments. 


    Below is an example of that approach. 

     

    1. Create two variables. One string variable for the ListName and one array variable for the CheckInComments

     

    checkincommentsarrayvariable.png

     

    2. Use a Send an HTTP request to SharePoint action to list all versions

     

    getallversions_sendanhttprequest.png

     

    3. Add an apply to Each action. Use the Results property for the select an output from previous steps field. Below is an expression for that.

    outputs('Send_an_HTTP_request_to_SharePoint_-_Get_All_Versions')?['body']['d']['Results']

     

    4. Use another Send an HTTP request to SharePoint action to list all FileVersion properties within the Apply to Each action. In that API call I am using the VersionID field from the previous Send an HTTP request response.

    _api/web/lists/getbytitle('@{variables('ListName')}')/items(1)/versions(@{items('Apply_to_each')?['VersionID']})/FileVersion

     

    getfileversion.png

     

    5. Add a condition within the Apply to Each action. Check if the results contain the property FileVersion

    outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']

     

    6. Add a Append to Array variable action in the If No section of the condition action.
    This check is needed because this API request for the latest version is empty. Otherwise the apply to each loop will error.

     

    Use the following json:

    {
     "Version": @{outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['VersionLabel']},
     "Check-In Comment": @{outputs('Send_an_HTTP_request_to_SharePoint')?['body']['d']['CheckInComment']}
    }

     

    condition_forarray.png

     

    7. Add a Create HTML Table action outside/after the apply to each action. Use the CheckInCommentsArray in this action.

     

    createhtmltable_checkincomments.png

  • jesstaylor90 Profile Picture
    4 on at

    Hi @Expiscornovus Thank you for your reply. I think I'm getting stuck at the 'Apply to each' section. I have tried putting your suggestion into practice with some changes as I kept getting run errors. The flow runs up until the 'Apply to each' and then fails at the 'Append to Array Variable' section, but I looked at the output of the HHTP request above it and it says the following, which makes me think it is failing there:

     

    {
      "d": {
        "FileVersion"null
      }
    }
     
    The URI of the HTTP Requests have been changed to have the folder name and the item ID, as this flow is meant to trigger when a file is modified. I did try with the ListName variable in these, but could not get the flow to move beyond these point until I changed it. Screenshots below:
    Forum1.PNGForum2.PNG
     
  • jesstaylor90 Profile Picture
    4 on at

    @Expiscornovus also I've noticed that the first http request does not contain all Check In Comments in the output, which is the same issue I have had before - its just the last comment repeated over and over. 

  • Expiscornovus Profile Picture
    33,830 Most Valuable Professional on at

    Hi @jesstaylor90,

     

    The first request is to list all version ids. In the second request (within the apply to each) I am using those ids to retrieve the check-in comment per file version. Via the FileVersion method you should be able to retrieve the individual check-in comment per file version.

     

    I see my screenshot of step 6 was cropped. In the if yes branch I do nothing (in my screenshot it was just a compose). This is because the file version request will be empty for the last file version. Can you remove that append variable 2 action, that action will fail.

     

    And can you also place the FileVersion keyword between double quote characters (i.e. "FileVersion") in your condition action? 

     

  • RobMolenaar Profile Picture
    112 on at

    This is exactly what I was looking for thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard