cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
leeyuh
Regular Visitor

Grouping list items into an html table under certain criteria and send email

Hello community!

 

My team has a share point list with the following columns:

Batch IDItem nameProviderCost
AB01Apple 1A50
AB01Apple 2A90
AB01Apple 3B10
AB03Apple 4A95
AB04Apple 5A78

 

I want to create a workflow when items under the same batch ID are created on the list, an email can be sent to each provider. In the email, I want to create an html table listing all the item name and cost under that provider. 

Email for Provider A - AB01

Item nameCost
Apple 150
Apple 290

 

Email for Provider A - AB03

Item nameCost
Apple 495

 

Email for Provider A - AB02

Item nameCost
Apple 578

 

Email for Provider B - AB01

Item nameCost
Apple 310

 

I am stuck in the step of grouping items under the same batch ID in one html table and one email. 

Could anyone help me out?

 

 

 

1 REPLY 1

Hi @leeyuh 

 

You can use filter arrays for this. 

 

Initialize an array variable to store all the distinct values for the column to group on. Then use an apply to each loop to iterate over each of the item in this array and add a filter array action to get only the rows that have the value in the current item for that column. You can then use the create HTML table action to create the 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! 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (4,107)