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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove duplicate value...
Power Automate
Unanswered

Remove duplicate values from one Excel column and copy the list into a new Excel file.

(0) ShareShare
ReportReport
Posted on by 21

I would like to remove all duplicate values in column [Sales Order #] from Excel file A. After that, the entire list (all columns) needs to be copied into a new Excel file B. Unfortunately, I do not have access to Power Automate Desktop nor Premium features. Is this possible?

Antje1_0-1690396718270.png

 

Categories:
I have the same question (0)
  • Mitanshu Profile Picture
    1,650 Moderator on at
    Re: Remove duplicate values from one Excel column and copy the list into a new Excel file.

    1 - Use Excel Online (business) connector with Action: List rows present in a table

    happyume_0-1690405809127.png

     

    2 - Now read your original file using this - the output in body/value will be an array.

     

    3 - Now add a compose action with formula:

    union(outputs('List_rows_present_in_a_table')?['body/value'],outputs('List_rows_present_in_a_table')?['body/value'])

    The union expression will give you distinct values from the array received in step 2.

     

    4 - Use the Select action to pick your desired columns

     

    5 - Write the output to your destination Excel file.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Antje1 Profile Picture
    21 on at
    Re: Remove duplicate values from one Excel column and copy the list into a new Excel file.

    Thank you very much. I got this far: 

    Antje1_0-1690460150957.png

    What function do I use to write the output as an Excel table? I used "create table" but ran into an error. I also need to make sure that the same file can be overwritten each time the flow runs.

  • Mitanshu Profile Picture
    1,650 Moderator on at
    Re: Remove duplicate values from one Excel column and copy the list into a new Excel file.

    Can you confirm if based on my previous reply, you were able to get unique/distinct [Sales Order #] from the union expression?

     

    happyume_0-1690461288990.png

     

     The union expression will give you an array and you should loop through this array in your Apply to Each

    Your select statement should contain all the columns that you are going to write in your destination file. 

     

    For your follow-up question:
    Is your destination Excel file already created (with blank table) and available in SharePoint/OneDrive?

     

    If yes, then you should add new rows to that Table in the destination Excel file so that each time the Flow runs, you are appending new rows to the same file.

     

    In case you want to over-write (replace) instead of append, then you will first need to list all rows in your destination file, apply to each row of destination table, delete row. After that you can then write rows to your destination table based on output of union expression.

    Creating a new table at every flow run will not give you a single destination table with combined results from all runs.

    happyume_1-1690461498631.png

     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item.

    If this post or my previous reply was useful in other ways, please consider giving it Thumbs Up.

  • Antje1 Profile Picture
    21 on at
    Re: Remove duplicate values from one Excel column and copy the list into a new Excel file.

    Unfortunately, I am not able to get the flow running. 
    It looks like I am getting unique values, but I am running into an issue during "apply to each". The flow will time out after 10min.

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard