Power Automate - Get SharePoint items using Created By/Modified By

Recently I had an interesting request where someone was trying to filter items based on the Created By field in SharePoint using Power Automate. I thought, that should be pretty straight forward, make a claim or something similar and I headed to Google.

Surprisingly there's not actually that many hits and it took quite a bit of digging. The answer once you realise is pretty straight forward.

SharePoint holds a hidden(ish) list, the "User Information List" you can view it by adding the following to a Site Collections URL: 

/_catalogs/users/simple.aspx

This list holds all the "Ensured Users" on the site - you can google that one if you want to find out more. It also holds the information on which you can use in the filters for People Fields. Here are all the useful filters you can use:

"ItemInternalId":"11",
"ID":11,
"Title":"Martin Pyman",
"Name":"i:0#.f|membership|martin@marnotechnology.com",
"EMail":"martin@marnotechnology.com",
"SipAddress":"martin@marnotechnology.com",
"IsSiteAdmin":true,
"Deleted":false,
"UserInfoHidden":false,
"Picture":"https://marnotechnologycom-my.sharepoint.com:443/User%20Photos/Profile%20Pictures/martin_marnotechnology_com_MThumb.jpg",
"FirstName":"Martin",
"LastName":"Pyman",
"WorkPhone":"123456",
"UserName":"martin@marnotechnology.com",

Keep in mind the Power Automate query uses the column internal names, which are Editor and Author respectively. The other part is how do you query into those People Fields, turns out all you need to use is a forward slash:


Hope it helps!

Comments

  1. Thank you for sharing such a useful article. I had a great time. This article was fantastic to read. Continue to publish more articles on

    Data Engineering Services 

    Data Analytics Solutions

    ReplyDelete
  2. Thanks for the article. I have a smiliar issue.
    My flow executes when a new record is added to a list.
    I have another list where I need to lookup my additional user settings. (Like IsApprover)
    This is stored in a list I called User with a field named User which is a "Person/Group" field.

    I need to lookup the extra user data based on the user who created the new record.
    I've tried many permutations but the OData returned is either empty or I get an error saying the field doesn't exist.

    Here's some of the filer queries I've tried:
    (where is the dynamic content of the new list item)
    User/Email eq ''
    Author/Email eq ''
    User.Email etc...
    Author.Email
    User
    Author

    None of these work. There should be an easy way to lookup a user in another list...
    What do you think??

    ReplyDelete
  3. You want to use Author/EMail eq '' note the capital M - they are case sensitive!

    ReplyDelete

Post a Comment

Popular posts from this blog

Use Power Automate to create a Document Set – The easy way!

SPFx Christmas Banner Treat