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 / Filter Sharepoint List...
Power Automate
Unanswered

Filter Sharepoint List by Person and Send Email with all items associated with their name

(0) ShareShare
ReportReport
Posted on by 63

I have a Sharepoint list that has information uploaded to it on a weekly basis. On a recurring basis, I want a flow to filter by the person field and send all the associated items to each employee without having to send an individual email per item. I've tried a few different things with no success. I saw @Tmalonson do something similar but did not fit quite what I was looking to do.

Categories:
I have the same question (0)
  • Tmalonson Profile Picture
    253 on at

    Yeah, that is a tad different from what I was doing, but I think we should be able to use a similar process.
    Edit: Just looked at the one you are referring to, can't use a similar process, but what you're wanting to do is still completely do-able.
    Do you have a start of any sort of flow that I can reference?

    Also, are you wanting the whole list to be processed each time? Or are there specific people that it needs to filter by?
    Part of the problem being that if there is nothing specific to filter by, then the Get Items() action won't actually return any results to work with, but if there are specific employees that we can identify then this won't be an issue.
    (There are some work-arounds to this problem, such as using a custom filter input like (Employee neq 'fx=null')
    A filter like this would return all items in the list that do not have a blank person column. This would however result in a very laborious flow that would likely have a slow runtime depending on the size of the list.)

    Which leads to my next question, how large is this list? What is our item count here?

    It should be easy enough to consolidate the files into a single email per employee, as that's what I did previously.

    Mostly, I'm just asking where I'm starting from here, because ground-up is a bit difficult without more knowledge of the list you're using.

    Also, side note: I've since de-commissioned that flow because the list began exceeding the threshold. I had to re-build the list as a document library and have yet to re-build a flow to to the same result.

  • gillgamm Profile Picture
    63 on at

    I'm starting from scratch at this point. Either a scheduled or a manual flow will work, Get all items (this list will be refreshed weekly with up to 100 items), filter by Employee column and send a single email containing all the list items assigned to a single person.

     

  • Tmalonson Profile Picture
    253 on at

    Okay, so here is what I would do.
    It's a little un-orthodox, but I think it'll work.

    To get the items initially, without bogging down flow, you can add a column in your list titled (Flow Modified), then hide the column in the view.
    Then, in your flow, you use Subtract from time() action to pull the timestamp and subtract 5 hours. This will make sure that it doesn't pull the same item twice, because we are going make this flow loop until it doesn't pull anymore items.

    In your Get Items() can now filter by "Flow modified is less than 'Calculated time' "
    Then you'll want to set your top count to 20.
    If the flow takes too long, simply lower this count until it functions within a manageable time frame.
    Then, set a Compose() action with the fx(length(Dynamic content 'values from get items'))
    Not only will this tell you during the run if you actually pulled the items, but we are going to use this later value to determine whether the flow loops.

    Then, similar to how my flow operated, you can use a For Each(Get Item)Get Attachments Append to Array variable > Send Email V2 etc.

    Then, at the end of the flow, not within any loops, you will create a condition.
    IF( Compose(outputs (is greater than) Zero ) 
    Condition YES(Resubmit FLOW() action)
    Condition NO(Terminate Flow() Action) - Set the label to Cancelled

    Set the ID of the resubmit flow to 1, then go back to your Trigger.

    Open the trigger settings and set the Tracking ID to 1.

    Here is a long-view of the general format; you'll want to refer back to my previous post that you kudoed for a more detailed explanation of getting the attachments.
    Note: this explanation isn't exhaustive because, after looking at your P.A. profile, you seem pretty familiar with Power Automate; so, I excluded things I thought would be assumed such as Initializing Variables and Dynamic inputs. If you have any questions, don't hesitate to reply.

    Once you get the flow made, you can probably change the trigger to a weekly scheduled, just remember that you'll have to correct the following items:
    1. Subtract time from action

    2. Trigger Settings - Concurrency Control and Tracking ID
    Note #2: if the resubmit trigger doesn't work, you can change back to a manual trigger and put the terminate condition immediately after the compose() following Get Items(). Then you can just manually submit the flow a few times until it returns a "cancelled" label.

    Tmalonson_0-1700071012631.png

     

  • gillgamm Profile Picture
    63 on at

    What if I don't need to include attachments? Just the details of the list item.

  • Verified answer
    Tmalonson Profile Picture
    253 on at

    Oh, well that would simplify this quite a bit.
    So, what exactly are you just needing to include? Is it information that is part of the existing item?
    As in, the information is simply within a different column on the same line item?

    In that case, you should be able to OMIT all of the attachment steps and move directly into a
    For Each(Item)Send an email V2 with specified format and dynamic content.
    The problem you may run into is that it won't accept the email as dynamic content from get items.

    You might need to set a variable within the For Each to hold the email address from the person column, and have it clear the variable after it sends the email (but before it finishes the loop).

    Tmalonson_1-1700075618566.png

     

  • Verified answer
    Tmalonson Profile Picture
    253 on at

    There is another flow that I have that filters a flow based on a date of expiration, then sends a specialized email to notify the managers that they are coming due. Elements from that flow could also be used to inform this one. It depends on the information you're needing to communicate and how.
    Mine was a tad complicated because it was needing to pull and communicate specific columns from the items; because of this, it had to run a manual filtering code on each item to determine if it should be included in the email body. 
    But if we want to just include all the columns, you could format the email and probably use dynamic content within the body of the email.

  • gillgamm Profile Picture
    63 on at

    Could you expand on the Compose action and the Resubmit Flow? Resubmit flow is not an action I've used before. 

  • gillgamm Profile Picture
    63 on at

    I'd like to include details of each list item in the email (assigned to that person) in a table as well.

  • Tmalonson Profile Picture
    253 on at

    Sorry for the late response, I was out for the Holdiday.

    1. The Compose() action uses the length() formula. By using fx(length(dynamic content(Get Items[Value])) we are able to look at how much data was retrieved and use that number as a condition later.

    Tmalonson_0-1701102742329.png

     



    2. To format information from the list into a table, you should be able to insert a table within the email body.

    Then, you should be able to place labels and dynamic content as desired.
    i.e.

    Name:dynamic content(Name): Joe Smith
    Project Title:dynamic content(P-title): SharePoint Connectors
    EtcEtc

    If it doesn't allow for a table insert, you can still format the information as desired; it just a takes a tad more effort.

    I.E.
    Name: dynamic content(name)
    Project Title: dynamic content(P-title)
    etc.

    Alternatively, you can place several things on the same line separated by colons: vertical lines | slashes/ underscores _ or whatever other method would look best.

     

    3. When concerning he resubmit flow, when you go to look at it, it will have you set up the connection just like Get Items(). You will select the flow to be re-submitted, and set the "ID" as 1. The environment and trigger name are negligible. Personal Productivity should work, and whatever title you want to identify a flow triggered by the loop.

    Tmalonson_1-1701102856197.png

    Then, you'll need to make sure that in the settings of your Trigger() you set the ID to 1.

    Tmalonson_2-1701102935599.png

    If that seems too complicated, or doesn't work, you can move the condition immediately after the Compose() action and remove Resubmit flow(). (Example below)
    Note: I realized that this flow will probably have a better runtime if we terminate when Compose(outputs) = 0

    Tmalonson_3-1701103143556.png

    If you choose to remove the Resubmit Flow(), then you'll just have to run the flow numerous times manually until a "Cancelled" condition is returned for the flow run.


  • EmilyK1 Profile Picture
    18 on at

    Hi @Tmalonson ! I am hoping to figure out a similar flow but I have a few questions.

    1. Regarding the step in this response to "add a column in your list titled (Flow Modified)" , I wanted to know what type of column this should be and if anything should be added to this column for each item in the list. 
    2. I am guessing my second question is related to the first question but when I try to filter the List items by "Flow modified is less than 'Calculated Time'", the "less than" option is not on the drop down. EmilyK1_0-1705528688626.png

       

    3. Finally, my last question is regarding your guidance for resubmitting the flow in your last response on this thread. I am unable to use the "Resubmit Flow" due to data privacy policies - would manually re running the flow until it terminates produce multiple individual emails for each item in the list associated with the individual email?

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 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard