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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / get current Sharepoint...
Power Automate
Unanswered

get current Sharepoint user

(0) ShareShare
ReportReport
Posted on by 2

I need to track SharePoint users who access a document. I have a flow that will receive an HTTP request, open the document from the library, and create an item in a SP list showing when the link was clicked. I want to automatically populate the list with the user who is currently logged into SP and clicked the link. I have tried various methods and they all return me, as the owner of the flow. How do I capture the logged-in SP user and incorporate into my flow?  I have found some info that says in SP Online the current user can be found in "_spPageContextInfo.userLoginName" but I am unsure as to how to use this in my flow. Can it be accessed through the JSON schema in "When a HTTP Request is received?  I'm fairly new to Power Automate and struggling to change over from SharePoint Designer.  Thanks!

Categories:
I have the same question (0)
  • fchopo Profile Picture
    8,003 Moderator on at

    Hi @Jerry_Cobbs 

    Unfortunately, you can't do that with Power Automate.

    On the other hand, you can use Power Automate to query the Office 365 Management Activity API which stores the information you need (who opened a file, who downloaded it, who visit a page, etc...).

    You can read an excellent article on how to do that here: Office 365 Management Activity API with Power Automate - Part Three - Leon Armston's Blog

    Hope it helps!

    Ferran

     

     

  • rrovira Profile Picture
    Microsoft Employee on at

    Hello, @Jerry_Cobbs

     

    Yes, as far as I know there's no way to check if a person has open the file (and not modified it). The solution I would recommend you is to use PowerApps to see what users are requesting the documents in the library. However, I'm not sure how you could extract the current user using "_spPageContextInfo.userLoginName". Perhaps another member of the communities could help you with that! 

     

    I'll leave here a similar post with some answers that could guide you through that process: https://powerusers.microsoft.com/t5/Building-Flows/Check-if-a-File-is-opened-in-SharePoint-Document-Library/td-p/530675

     

    Cheers,

    Rodrigo

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard