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 / Retrieving CreatedBy -...
Power Automate
Answered

Retrieving CreatedBy - Modified Person Name of Different Versions of a SP Online Document after Getting Versions using REST API

(0) ShareShare
ReportReport
Posted on by 112

Hi Community,

 

With an automate flow, after using REST API call to get all versions info of SharePoint online library document, the output result I got is something like below the screenshot show.  One piece of data that I really need is the name of the person who modified each version, in the metadata it appeared to be the "CreatedBy" data point.  The challenge is the documents I need to check all versions not really from a SP Lists, and the output file doesn't provide anything that indicate the person ID / name etc. information.  Is there a way to get the "CreatedBy" (modified by of each version) using other actions in a flow? 

 

1134.png

 

The CreatedBy "uri" in full is showing like this:

 

"CreatedBy": {
"__deferred": {
"uri": "https://abc.sharepoint.com/sites/name/_api/SP.FileVersion1f8c8ebe-c372-48ac-b97d-c8f1f1513944/CreatedBy"
}

 

Any suggestions would be greatly appreciated! 💐

Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    What REST endpoint are you using? Created By is actually represented by the AuthorId.

    It is a Lookup Field so you need to use the Expand property.

    /Sudeep/_api/web/lists/getbytitle('Documents')/items?$select=Title,Author/Name&$expand=Author l

     

  • sc0rpiongirl Profile Picture
    112 on at

    Thanks for the suggestion. Looking at this api, looks like this needs to be lists.  I got the versions using this line:

    _api/web/getFileByServerRelativeUrl('@{triggerBody()?['text']}')/Versions

    where triggerBody text is "RelativeLink" that is passed from power app.  I have a gallery of documents that are from SP online library, the URL for the documents are https://abc.sharepoint.com/sites/sitename/libraryname/document.docx for example.  With the RelativeLink, I retrieve all the versions but as my screenshot showed, there is no list ID, library name, item name nor item ID in the versions output.  You suggested code means I need to use the document title?  I could try but I am not sure it will work...

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Try to retrieve the versions using this endpoint

    _api/web/lists/getbytitle('Documents')/items(95)/versions

     

    SudeepGhatakNZ_0-1713921638195.png

     

  • sc0rpiongirl Profile Picture
    112 on at

    Thank you for the reply. I have tried that but it only yielded the latest version instead of all versions, which is puzzling. I documented this exhausting exercise exhaustedly in a separate thread because it focuses on a different topic. (https://powerusers.microsoft.com/t5/General-Power-Automate/Use-REST-API-to-Retrieve-All-Versions-of-a-SharePoint-Online/m-p/2716575

    it’s supposed to be a straightforward flow but apparently it wasn’t in my case. 

     

     

  • sc0rpiongirl Profile Picture
    112 on at

    I should report back that I just ran the flow with the endpoint you suggested ie using getByTitle('Documents')/Items(IteamID), actually it returned 404 file does not exist.  

     

    The goal is to get all versions with the key information including VersionLabel, Modified Time (Created), IsCurrentVersion, URL (to that version) and Modified By (CreatedBy), as we were to be able to see when we are in SP library right clicking on the 3 dots >> Version History.  So far, I am not sure how to get the last piece of information ie CreatedBy for every version (not just the latest version which I could obtain quite straightforwardly.)

     

    Thank you!

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    Did you specify the ID of the Document item?

    YourSiteUrl/_api/web/lists/getbytitle('Documents')/items(95)/versions

     

  • Verified answer
    sc0rpiongirl Profile Picture
    112 on at

    Yes.  In fact, after trying several different uri, I finally got the result via this:

     

     

    _api/Web/Lists(guid'ListGUID')/Items('ItemID')/Versions

     

     

    Thank you for your suggestions which helped me to explore more options.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 233 Super User 2026 Season 2

#3
Valantis Profile Picture

Valantis 136 Super User 2026 Season 2

Last 30 days Overall leaderboard