web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create HTML table taki...
Power Automate
Unanswered

Create HTML table taking too long for emails

(0) ShareShare
ReportReport
Posted on by 8

Hi All,

 

I have a flow which has a loop for 12 countries. Inside the loop I am fetching the country record details for each year using create HTML table. I need to trigger emails to owner of each country. The record count for 1 country is 4000. I have used create HTML table thrice to get records by year. I also need to remove duplicate ids while creating TO list for which I have used union operation.The problem I am facing is it takes too much time to process these actions. Can anyone help me please or provide an reference on how to get the 4000 records faster in email

 

 

thanks

sandhya M

Categories:
I have the same question (0)
  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @SandhyaM ,

     

    please provide sample data and desired output and maybe your current approach.

  • Marcel Lathouwers Profile Picture
    237 on at

    It sounds a bit like a bad business process to distribute 4000 records over email. 
    It would be better to have an app (model or canvas) to let the user interact dynamic with the data. 
    you could also check if paginated reports in powerbi is a good way fwd 

  • VictorIvanidze Profile Picture
    13,073 on at

    Show your flow.

  • SandhyaM Profile Picture
    8 on at

    Thanks Mglat yes even I feel the same way. Will try to connect with the user and explain him about it. Just want to understand setting apart that is there some limitation on this action create HTML Table so that I can add this point as well while try to explain the user

  • SandhyaM Profile Picture
    8 on at

    Hi Matty, Apologies I cannot share the screenshots. The scenario is I need to send the list of blank records in one column to few users. The issue is the number of records is around 4000 which can be still more and if I use the action create HTML table to show in the email it will be a very long email and to process one loop it takes more than an hour+

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Without seeing the current solution it is hard to say what can be done better. There are a lot of topics in this forum that show how to create html tables. You talk about a loop. I don't understand the loop thing if you want to create an html table. But of course if you send different html tables to different users you will need some kind of loop. I just tested the creation of an html table with 4000 records and it took less than 1 second.

     

    Matthy79_0-1690202217584.png

     

    And sure. If you want to send 4000 different emails it will take some time but you can turn on Concurrency Control to speed things up. But as far as I read it, this is not the case.

  • SandhyaM Profile Picture
    8 on at

    Hi Matty, The  present logic is as follows.
    We need to check the count of blank records per year per country and send email to a list of users.
    The current design is as follows.

    1. I have got all the countries into an array and then using Apply to each I iterate through each country.
    2. Inside the country loop I have another loop which iterates through year array which has been hardcoded for the required years.
    3. Now inside the second loop(Year Loop), I have used List the rows from dataverse table belonging to the country and the year.
    4. I have used a switch statement and based on the year 3 separate array variables are appended with each of the record from dataverse using Apply to each action. Here is the thing. This action Append to array variable will have to be run 4000 times. for each of the List rows from dataverse. 
    4. Once the first year is populated again it needs to iterate through the second year and so on.
    5. After the three array year variables are populated I have used Create HTML Table for each of the array variables. 
    6. Once 3 HTML Tables are created, I will add them to the email.

    Please let me know if this approach can be updated.

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Hello @SandhyaM ,

     

    ok, I do understand the problem and I'm not surprised that it takes forever. To help redesign the flow I have to understand the data model. The easiest way would be to send some dummy data and the desired output.

  • Marcel Lathouwers Profile Picture
    237 on at

    Hi @SandhyaM 

    Assuming that the dataverse table that ends up in the HTML also have the year value and country value in it, you can do the following: 

    1. List all countries
    2. Get the 'base data' tabel, by using the fetchXML, so you can sort on country and year
    3. Apply to each country (from step 1)
      1. Filter on country. 
      2. Create HTML from output step 4 (should be all records from 1 county, sorted by year)
      3. Send mail

     

    If you make the appy-to-each step concurrent (three dots > settings) then I suspect this flow will run in under a minute

  • SandhyaM Profile Picture
    8 on at

    Hi Mglat, Thanks for your response. Regarding your solution, I had few doubts

    I want it to be grouped by year as in the below example.

    Year : 2021
    HTML Table 1
    Year : 2022
    HTML Table 2

    Since the email will be composed outside the year loop as I need to send all the data of a single country to users of that coutnry I will not be able to access the output of Create HTML Table in the outer loop.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard