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 / Get E-mail address of ...
Power Automate
Answered

Get E-mail address of LockedbyUser

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I'm running a flow which updates certain file properties. The flow fails if the file is open by someone, the error message says something like "the file is locked by user". The flow works in a loop, so eventually when the user closes the file it updates the properties, however it can take a while. I want to send an HTTP request to SharePoint to get the LockedbyUser and send an E-mail to that person asking to close the file. Now the request I believe should look like this:

 

GET http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/lockedByUser

 

However I'm struggling with translating this into an E-mail address to use in the "To" field of the Send an E-mail action. Can anyone help with this part, please?

 

Thanks!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Is this what you are looking for?  

    PowerOutage_0-1611354792346.png

     

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Yes, in the end I managed to find the Parse JSON code to do this.

  • GHobbs Profile Picture
    6 on at

    Can you share the Parse JSON code to do this?

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at
    {
     "type": "object",
     "properties": {
     "d": {
     "type": "object",
     "properties": {
     "LockedByUser": {}
     }
     }
     }
    }
  • GHobbs Profile Picture
    6 on at

    Hi again, I am struggling with the first part of this process i.e. the HTTP request to SharePoint to get the LockedbyUser.

     

    I understand that I need to enter this formula:  http://<sitecollection>/<site>/_api/web/folders/getbyurl(folderrelativeurl)/files/getbyurl(filerelativeurl)/lockedByUser

     

    But I am not sure which dynamic values to use... here's what it looks like on my end. Any thoughts on what I am doing wrong?

    GHobbs_0-1656615789231.png

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I use a different approach to get the file:
    getbytitle('library name')
    items(item ID of document)

     

    PowerOutage_0-1656616178330.png

     

    This post looks like it might be using the same approach as you:
    https://www.thetindog.com/dynamics-as-we-go/identifying-sharepoint-file-locks-with-power-automate

     

  • GHobbs Profile Picture
    6 on at

    Thanks, but now I am getting an error 404 with the message "Cannot find resource for the request getbytitle".

    Any thoughts?

     

    GHobbs_0-1656617704234.png

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Are you using the correct name for the library?
    If your display name is Library Name, then you'd want to use Library%20Name in the flow Uri.

    If that doesn't work, please post the full URL of your site and library, being sure to mask any sensitive words.
    sites/parent/?child?/My%20Library/Forms/Allitems.aspx

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 589

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 284 Super User 2026 Season 1

Last 30 days Overall leaderboard