Skip to main content
Community site session details

Community site session details

Session Id : xp0oIxaqcnsHsoN5TZ4V9n
Power Automate - Building Flows
Unanswered

Help with a flow - get email address from people picker, send email to said address's

Like (0) ShareShare
ReportReport
Posted on 18 Mar 2024 11:35:19 by 4

Hi, 

I recently had a working flow where it achieved the following: 

1. On a recurrance, get items form a SP list. 

2. Select specific information from said list, in this case, look at a people picker column and obtain "Director Email". 

3. Filter the array, to ignore blanks

4. Create a HTML table with results of emails

5. Send an email to said email address's. 

 

I now want to be able to add in a second select function (I think) to enable the flow to select email address's from the "Director" column and also the "Manager" column, and then continue on with the rest of the flow, so the email to be sent, is sent to both the applicable director, and manager (where it finds an email for said individuals). 

If the director and or manager column is blank, I want it to ignore it and continue on. 

 

 

I cannot work out how to add in the second column, does anyone have any ideas? 

DynoJam387_0-1710761673824.png



Appreciate I may have explained some of that incorrectly, so please feel free to ask anything you need clarified. 

Many thanks in advance! 

  • Expiscornovus Profile Picture
    32,187 Most Valuable Professional on 02 Apr 2024 at 13:36:02
    Re: Help with a flow - get email address from people picker, send email to said address's

    Hi @DynoJam387,

     

    In your screenshot it looks like your are missing a space in your action name and the name you are using is actually Filter array- empty directors instead of Filter array - empty directors.

     

    In that case the reference would be invalid and you would have to update your query to that name, for example:

    union(body('Filter_array-_empty_directors'),body('Filter_array-_empty_directors'))

     

     

  • DynoJam387 Profile Picture
    4 on 02 Apr 2024 at 12:39:44
    Re: Help with a flow - get email address from people picker, send email to said address's

    This is the expression I used as per your instructions:

    union(body('Filter_array_-_empty_directors'),body('Filter_array_-_empty_directors'))

     

  • Expiscornovus Profile Picture
    32,187 Most Valuable Professional on 02 Apr 2024 at 12:31:26
    Re: Help with a flow - get email address from people picker, send email to said address's

    Hi @DynoJam387,

     

    The error suggest that your union expression in the Apply to each action might contain a wrong reference to your Filter Array action. Can you share what expression you used?

  • DynoJam387 Profile Picture
    4 on 02 Apr 2024 at 11:15:12
    Re: Help with a flow - get email address from people picker, send email to said address's

    Thank you for your quick response, and apolkigies for taking so long to come back to you on it. 

    I believe I have updated the flow as per your instructions, However it does not like a certain something, and I am not sure what specifically. Here is another screenshot:


  • Expiscornovus Profile Picture
    32,187 Most Valuable Professional on 18 Mar 2024 at 16:13:21
    Re: Help with a flow - get email address from people picker, send email to said address's

    Hi @benwithers,

     

    Sorry, I misunderstood. In that case you can just filter the outputs of the first Select action with another filter array.

     

    Below is an adjusted example

     

    1. First Filter Array

    @not(empty(item()))

     

    2. Union in Apply to each

    union(body('Filter_array_-_empty_directors'),body('Filter_array_-_empty_directors'))

     

    3. Second Filter Array which uses the Get Items Value in the from.

    @equals(item()?['Director/Email'], items('Apply_to_each'))

     

    emptynullvalues.png

  • benwithers Profile Picture
    25 on 18 Mar 2024 at 15:45:08
    Re: Help with a flow - get email address from people picker, send email to said address's

    It could be there is a much simpler way of doing this, but what I actually want to achieve is to:

    have a flow go through a list, get all the email address's from the people picker column "Director" and have the flow send an email to all of those email address's it finds. 

    Annoyingly there will be some "null" values in the director field so I need it to ignore those with null and give me a list of email address's (I assume?) that I can then use to populate the "To" field in the "Send and email V2" action at the end. 

    Hopefully I am explaining that accurately enough. 🙂 

  • benwithers Profile Picture
    25 on 18 Mar 2024 at 15:41:49
    Re: Help with a flow - get email address from people picker, send email to said address's

    Hey Expiscornovus.

    Thank you for your reply. I have tried your solution as above but the condition is pumping out a "false" and so not I believe it is not populating the remaining 2 tasks (HTML table + send an email with obtained email address's). Here is a screen shot of the flow run to try and highlight what I mean: 

    benwithers_0-1710776446246.png

     

    Here is another screen shot of the actions you have suggested I try, expanded, so you can see what I've done:

    benwithers_1-1710776500752.png

     




  • Expiscornovus Profile Picture
    32,187 Most Valuable Professional on 18 Mar 2024 at 14:58:13
    Re: Help with a flow - get email address from people picker, send email to said address's

    Hi @DynoJam387,


    I see you used the [0], this would only retrieve the first item of your list of values (Value field in the From). I would suggest to remove that, since you want to loop through all items.

     

    I would also change the format of your and function. Normally the syntax is:

     

     

    and(<expression1>, <expression2>, ...)

     

     

     

    Can you try the below instead? (I am assuming you not only want to check for empty in the array, but you also want to filter on the current item of the apply to each loop. In this I am checking if the current item value in the Director field).

     

     

    @and(and(not(empty(item()?['Director/Email'])),not(empty(item()?['Manager/Email']))), equals(item()?['Director/Email'],items('Apply_to_each')))

     

     

     

    After that you can check the length of the outputs in a condition action.

     

     

    length(body('Filter_Array'))

     

     

     

    If it is greater than 0 it has found a match and you can continue creating a HTML table and send an email in the If Yes section.

     

    currentitem_applytoeach.png

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Loading complete