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

Creating HTML table from 'list records' grouped by leads created by the owner?

Hi. 

I have a requirement where I have to create the html table to further use it as an output for the email action. 

The html table is currently getting all the leads created in the last 7 days after I used the filter query : createdon ge adddays(utcnow(),-7). 


 What I want is : 
I want to create the html data in such a way that for every owner, the number of leads details should be there in the html data. How can I achieve this? 

3 REPLIES 3
PrasadAthalye
Community Champion
Community Champion

You can create an array variable and add all unique Owners by looping through output of list records..

 

Then again run a loop on array variable, take each item and filter list records for that owner. Then generate HTML table from that output and use it in the email.

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community
jimxmy
Frequent Visitor

Hi @PrasadAthalye 

What do you mean by the: "take each item and filter list records for that owner"? 

How do I do that? Do you intend to mean that I take another list records action from the Dynamics 365 and then in the 'filter query', put the array variable?

I am a bit confused. 

Thanks.

No. I mean you already have List Records with filter.

 

Create Array variable. Then run a loop on List Records and check if Array variable has Owner or not? If not, add it. This way you get all unique Owners.

 

Then Run a loop on this array and filter same List of Records from Dataverse action by matching Owner. Convert that output to HTML table and send email... 

 

Refer below thread to just get an idea..

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Need-to-send-specific-rows-to-specific-pe...

 

 

 

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

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.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,696)