cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Julien2
Kudo Kingpin
Kudo Kingpin

HTML table prints duplicate rows

Hello,

 

I have used to create HTML table action to map some fields and display them in an email.

Unfortunately, I couldn't find a value for case action in dynamic content to fill the *From.
Besides, I have used List records action and I was able to fill the *From field.
But as a flow results in the Create HTML table action prints duplicate rows, since it should print only one row.

I want to trigger the following fields in the flow below:

Flow.PNG

Here are the results:

Flow Result.PNG


What I should change to make the HTML table action print only one row?

 

Any help will be greatly appreciated.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Hey @Julien2 

 

Looks like the list records action is getting 3 records which is why the three rows are getting created. Can you shift back to the test array? 

 

Initialize a test array variable before the condition and then in the condition add a set variable action and in the value part add this: 

 

[

{

"Case Number" : "selectthecasenumberhere",

"Case Title" : "selectcasetitlehere",

"Service" : "selectthecomposeoutputhere",

"Closed Date" : "selectcloseddatehere"

}

]

 

Now, add the create html table action and select the variable (do not customise columns) and try this. This should resolve your issue. 

 

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!

View solution in original post

21 REPLIES 21
yashag2255
Super User
Super User

Hi @Julien2 

 

You can create an array first with the filtered values. From your flow, I can see that you are not filtering the values returned from the list records action (because then in the condition branch it would create an apply to each loop and my guess is that the condition is checking the status reason for the get record action). 

 

Once you filter the records appropriately, add an append to array variable action within the apply to each loop and then create the HTML table outside using the array. I did a sample of detecting and deleting duplicate records from dynamics using the arrays and creating html tables and you can find it here: https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Delete-duplicate-records-items-fro...

 

You might also want to check the status reason filed that you are implying in the condition as it might be looking for an integer value for that particular status reason instead of the label. 

 

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!

Hello @yashag2255 ,

Thanks for your reply.


I have created a filter array action to check for the status label records that are equals to "Resolved", then apply to each action inside it an Append to array variable action that contains all the related fields, and I have used the TestArray in my HTML table.
But as a result in the apply to each action, unfortunately, it returns 24 rows which means the HTML table prints again duplicates rows.

Please take a look at what I've modified:

Modifications.PNG
Here are the results:

Photo1.PNGPhoto2.PNG
What did I miss?

 

Looking to hear from you.

Thanks again!

Hello @yashag2255,

 

Any suggestions to solve this issue?

Looking to hear from you.

Thank you.

Hey @Julien2 

 

It will not work like this. you need to add the key value pairs in the html table as shown in the post that I have shared with you. 

 

 

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!

Hi @yashag2255 ,

 

I have changed in the Html table the columns to Automatic and I am already using the "TestArray" variable in the HTML table.

The flow fails when I have switched the columns to Automatic also the apply to each function always returns duplicates rows.
Please take a look at the screenshots below:

CaptureResult.PNG

Cap2.PNG

What could be the issue here?

 

Looking to hear from you.

Thank you!

Hello @yashag2255,
Could you please provide an example similarly to my following issue because the blog you mentioned it's helpful but it looks different to my requirements because i have many fields in the HTML table.

Looking to hear from you.
Thank you!

Hey @Julien2 

 

Can you describe a little more about the scenario that you are trying to build? For some reason, I think there is a disconnect in the condition statement to check the status value. 

 

If you can share more details, we might be able to assist you better with this. 

 

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!

Hello @yashag2255,

Sure, please take a look below for the clarification of the flow:

  • When a status of a case has been set to Resolved I want to send an email for the user who created the case within his case details in an HTML table template.
  • The email template as I mentioned will be an HTML table that requires to display the following fields:
    Case Number, Case Title, Subjects(The subjects field is a lookup from Subjects entity where my subjects exist), Modified On (To show the user the time when the case is closed).

Concerning this condition, I have selected the Status Label from the dynamic content of the action when a record is updated. I didn't face any problem with the condition because as a result, it returns true.

 

The main problem is that the result of the HTML table, instead of printing the current row that was modified it outputs many rows. So it should only display one row as a result of the selected fields in HTML table.

 

I hope that you understand my requirements.

Looking to hear from you.
Thanks for your support.

Hey @Julien2 

 

Can you also share the entire flow that you have built so far? 

 

What is the trigger you are using? In my opinion, based on the scenario that you have shared, the flow configuration should look somewhat like this: 

 

1. Trigger-> When a record is updated (try using the CDS connector and you can filter on the status value itself) and this one will be for the case entity. 

2. Action-> get record from the case entity, use the identifier from the above action. 

3. Action-> get record from the subject entity and use the identifier from the dynamic content of step 2. 

4. Create HTML table with all the custom columns. 

5. Send email. 

 

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!

Hi @yashag2255,

 

Sure, please take a look of my entire flow screenshots:

FlowPic1.PNGFlowPic2.PNG

FlowEmailResult.PNG

Services mean the subjects' entity.

I've used List records using the CDS connector to trigger the subjects entity and used it in the HTML table.
After that, when I have switched the value of the HTML table from the TestArray to the value of the list records of the subjects entity, it outputs 3 rows. Where it should print the only one row.
We are very close to solve this issue.

Could you please take a try on my following flow and tell me your results?

Looking to hear from you.
Thank you very much for your support.

Hello @yashag2255,

 

Any news about the following issue?

Thank you.

Hi @yashag2255,

Please, could you assist me to solve this issue?

Hello @yashag2255 ,

Any suggestions?

Looking to hear from you.

Thank you!

Hey @Julien2 

 

Looks like the list records action is getting 3 records which is why the three rows are getting created. Can you shift back to the test array? 

 

Initialize a test array variable before the condition and then in the condition add a set variable action and in the value part add this: 

 

[

{

"Case Number" : "selectthecasenumberhere",

"Case Title" : "selectcasetitlehere",

"Service" : "selectthecomposeoutputhere",

"Closed Date" : "selectcloseddatehere"

}

]

 

Now, add the create html table action and select the variable (do not customise columns) and try this. This should resolve your issue. 

 

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!

Hi @yashag2255 ,

Thanks for your reply.

 

I have followed the steps you mentioned and as a result the HTML table output one row.

Unfortunately, when I resolve a case for a record I receive the same emails 3 times, knowing that I have one send email action.

 

Please take a look at the modifications and the result:

Flow1.PNGDuplicate email.PNGFlowResult.PNGFlowResult1.PNG

 

Any idea why I am receiving duplicates emails for the same record?

Looking to hear from you.

Thanks again!

Hi @Julien2 

 

Can you check the flow run history to see how many times the flow was triggered (was it three times?)

 

Is the send email action in an apply to each loop? Can you repost the entire flow config again? 

 

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!

Hello @yashag2255

Yes it was three times the flow was triggered please take a look here:

3 times.PNG

No, I have removed the condition from the apply to each action.

Please take a look of the entire flow:

EntireFlow.PNG
I have tried today, and the flow was triggered twice and I have only solved the case once it's weird.
Here are the results:

Capture2.PNG

 

Looking to hear from you.

Thank you!

Hi @Julien2 

 

Yes. That is the reason why it is sending multiple emails as the flow is getting triggered multiple times. The trigger you are using is when a record is updated so no matter if any attribute is updated it will trigger and run the flow. 

 

Now you can go into each run and check what has happened in that particular run and check the condition was satisfied or not. 

 

I think in the dynamics triggers, you cannot set attributes on the filter or trigger conditions and that is why I recommend building the entire flow using CDS connector. 

 

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!

Hello @yashag2255,
 

That's right, I have resolved the same case ID once and on each run the condition result is true. Knowing that it should only be triggered once.

Meanwhile, I have created the same flow using the CDS connector(Current environment).
In the first action in the Filtering attributes field, I have entered the Status Label schema name. (Because the flow will run only if this status will be updated).
Please take a look here:

NewFlow.PNGConditionFlow.PNG

The result of this flow using CDS connector I have received 7 consecutive emails:

CaptureResults.PNG

Concerning the condition, I was not able to find the label of the status from the dynamic content of "When a record is created, updated, deleted".
Because I should check if the status label is equal to resolved then I will create an HTML table and send an email.

 

Any suggestion on how to map the label of a field from a CDS connector in a condition?

Looking to hear from you.
Thank you!

 

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (4,738)