cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Can't get Union expression to consolidate duplicate email addresses to send a single email to employee with multiple records in sharepoint list

Hi everyone,

 

I am having a lot of trouble setting up a flow to send a single email where there are multiple items in a sharepoint list with the same email address.  Basic premise of the flow is to send an email to employees who haven't applied a total of 100% of their time to a given project for a given month.  Below is an example of the data in a sharepoint list:

image.png

 

Ideally I want the flow to send a single email to 'Bob' for the month of July 19 even though he has a total of 3 items in the list.

 

I have tried to apply the same flow as the solution given here: https://powerusers.microsoft.com/t5/Building-Flows/flow-to-send-single-email-for-set-of-records-in-S... 

 

But when I set up my flow the same way, I would still get 3 emails for bob instead of 1.  It appears the the union function does not appear to work for me.

 

Flow looks like this:

image.png

image.png

 

Union expression defined as: 

union(variables('Email Address'),variables('Email Address'))
 
Any help would be greatly appreciated.

 

Thanks

 

2 REPLIES 2
Highlighted
Dual Super User III
Dual Super User III

Hi @Kruchiver 

 

I would suggest a different approach here for the flow you are trying to build: 

1. Manual trigger

2. Intialize an array variable

3. Get items from the sharepoint list and in this get items action, add a filter query to get items that match the 100% time criteria. 

4. Apply to each loop on the items from the above action

5. Condition --> left box, select the array variable - operator: select 'does not contain' -- right box, select the email address column

6. Complete the loop

7. Apply to each on the array variable,

8. Get items from sharepoint and now use the filter query to filter the email column and point to current item, add another query to match the 100% time criteria. 

9. Add a send email action and use the current item as email address and add all relative information (maybe as an html table)

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Highlighted

Thanks for providing a response.  However, I can't quite follow.  Would it be possible for you provide screenshots of your proposed solution?

 

Thanks

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (12,875)