Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mamsteroonie
Helper I
Helper I

Dynamic Power Automate Fields need grouped together

I have a Power Automate flow within Power Bi Desktop that uses dynamic Power BI fields...The idea of the flow is to check to see if a person is overdue by a date range and send an email to the manager for that person.  However if there are more than one persons overdue, I do not want the manager to receive seperate emails.  The apply to each step causes this.  How do I combine the overdue email into one for the managers for a certain date range?  For example, three employees are at least 3 days overdue and have their managers copied in one email.

I'm attaching the pictures of my flow.  I've googled this a lot and I've seen things about unions, appending arrays, etc but nothing seems to work!

 

This seems like something a lot of people would want.  Please help.

High level view of flow

mamsteroonie_0-1659394605533.png

Condition to send the email

I feel like I need the apply to each here:

mamsteroonie_1-1659394650106.png

Then I send the email.  In the To Box, I want all the manager names to populate for that condition (which is held in one dynamic Power BI field)

mamsteroonie_7-1659394839519.png

 

 

7 REPLIES 7
mamsteroonie
Helper I
Helper I

I still can't get this to work, unfortunately.  going to a Power Platform conference and will ask there

I did some test and the "Send email"  action doesn't even want an array. It wants a list of emails separated by semicolon.  So all you need to do is initialize an empty variable and then in each iteration add the email and a semicolon.  After the loop use the variable for the TO: field.

mamsteroonie
Helper I
Helper I

Yes, outlook automatically realizes it's the same person and only sends the email once so I'm not worried about that happening.  So if it's a Power Bi field, how so I make the array variable?  All the examples I see online are arrays with actual typed out values.

lbendlin_3-1659537739180.png

 

 

 

mamsteroonie
Helper I
Helper I

I actually need one giant email that is sent to all the managers with the overdue employees.  So I dont think I need an array for the employees.  Thoughts?

in that case you only need an array for the managers.  You might even get away with adding all managers to the TO box and ignore the fact that some managers may be listed multiple times. They should still only receive the email once.

lbendlin
Super User
Super User

You would need to create a "Managers"  array variable and then populate that with all the managers that you have listed. For each of the managers you would then need to create another array that holds all the employees that are overdue.   After you have processed the Power BI data you would then have to iterate through the Managers array to send one email to each manager, including the manager's specific array of users.

 

You sure you want to do that?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.