cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jstott
New Member

Duplicate Rows - add row in Excel table when new email arrives

Connected Apps:

- Excel Online (Business)

- Office 365 Outlook

 

Hello Everyone,

 

I am running into some troubles with a Power Automate Flow that I have created and I couldn't find an existing solution to my particular problem. I would greatly appreciate any help or suggestions with this. 

 

Problem:

Adds duplicate entries in excel table when new email arrives.

 

Background:

My division books hotels for employees daily and I do the expenses reports for these bookings. The hotel confirmation emails get sent to a distribution group that then removes the price from these emails before sending them to the employee directly. 

 

Currently, my flow takes specific data from the hotel confirmation emails (extracted from the HTML code within the email's body) and adds it to a table in an Excel spreadsheet on my OneDrive. Ever since I built this flow, it has always created duplicate entries in the table, which hasn't been a big deal to me because my VLOOKUP formulas still work fine.

 

However, I now want to make my flow automatically send the confirmation emails to the employees with the price removed (which I have made work), but the duplicate entries cause two emails to be sent out, which I don't want. 

 

Ideally, I would just like one entry to be added into the Excel table when a new email arrives. I don't know how to get around this and I would appreciate any help in regards to this. Also, If I send a test email to myself with the same information, it only creates one entry. It only creates duplicates when the hotel booking website sends them. I will post some screenshots below.

 

(The second email in the 'From' section is mine so I can test the flow. The other one is the email of the hotel booking provider.)  

 

Flow 1.PNGFlow 2.PNGFlow 3.PNG

 

1 REPLY 1
Serbay
Advocate II
Advocate II

Hi, You can use the union function to find duplicate rows. And return only one of them, then you should able to send only a single email. 

please, use union(body('Select'),body('Select')) in compose action

Untitled.jpg

 

 

 

 

 

 

 

 

 

 

If I have answered your question, please Accept the post as a solution. 

If you like my response, please give it a Thumbs Up. 

Regards,

Serbay

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Users online (37,857)