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?
Appreciate I may have explained some of that incorrectly, so please feel free to ask anything you need clarified.
Many thanks in advance!
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'))
This is the expression I used as per your instructions:
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?
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:
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'))
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. 🙂
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:
Here is another screen shot of the actions you have suggested I try, expanded, so you can see what I've done:
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.
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2