Filter queries in the Get items action in the SharePoint connector are quite easy, but what if you want to filter by a SharePoint People field?
Table of Contents
In SharePoint I’ve got a list that has a people field on it. This field is called Person1.
I now want to find all items in this list when a new item is added to the list that has the Person1 set to the same person as the Person1 field for the item just created.
So in short filter list items by a people field’s value found in SharePoint.
The flow will start with a trigger “When an item is create or modified. This will give me a user details for the Person1 field. The only thing that I will not get is the user id for the person1 user. But this is what I will need later.
A While ago I wrote a post about getting the user id for a user. In this post i’m going to use the same method again
The User It will be used later on so that I can build up the query that will look like this:
Person1Id eq 11
Person1 is my fieldname. The Id that follows this field name indicates that I query the ID of the person field. The 11 is the user id of my user.
We need to have a bit more of a detailed look at this code.
The trigger gives me the email address of the user selected in the Person1 field. Now i can query the User information List using the user’s email address.
And finally I’m getting the query completed by using the user returned in the first Get Items action. I will only ever get one user returned, therefore I can safely take just the first item in the array, avoiding on of those unnecessary apply to each steps.
The code used in this last step is:
first(body('Get_items_-_User_ID')?['value'])?['ID']
Recently Microsoft added AI Functions to Dataverse that can be used in Power Apps. In…
One of the outstanding issues with the new Power Automate Designer is Copy and Paste…
Within the SharePoint admin centre there is that little detailed overview, telling you the available…
Within Power Apps there are various ways to document your app. In this post I'm…
Recently I've been asked quite a few times to duplicate SharePoint lists as part of…
Today, I was asked about how to create a lookup to a document or item…