Skip to content

Power Automate

Remove Duplicates From Power Automate Array Formula

Remove Duplicates From Power Automate Array Formula Posted by - Matthew Devaney on - September 8, 2024 6 Comments You can remove the duplicates from a Power ...

Matthew Devaney
Published
Reading time
2 min read

Before you start

Is this guide for you?

Best entry point
Power Automate
Time investment
2 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/remove-duplicates-from-power-automate-array-formula/. Author: Matthew Devaney.

Remove Duplicates From Power Automate Array Formula Posted by - Matthew Devaney on - September 8, 2024 6 Comments

You can remove the duplicates from a Power Automate array in two easy steps: add a Compose action and insert a Union function . The Union function combines two arrays together and returns only unique items.

Example #1: Remove Duplicate Emails From An Array

This Power Automate code shows how to remove the duplicate emails from an array. Code EmailsArray variable: [ " [email protected] " , " [email protected] " , " [email protected] " , " [email protected] " , " [email protected] " , " [email protected] " ] Code language: JSON / JSON with Comments ( json ) Union function code:

union(variables( 'EmailsArray' ),variables( 'EmailsArray' )) Code language: JavaScript ( javascript ) Result

Example #2: Remove The Duplicate User Records From An Array

This Power Automate code shows how to remove the duplicate user records from an array. Code UserArray variable:

[ { "ID" : 1 , "Email" : " [email protected] " }, { "ID" : 2 , "Email" : " [email protected] " }, { "ID" : 1 , "Email" : " [email protected] " }, { "ID" : 3 , "Email" : " [email protected] " }, { "ID" : 4 , "Email" : " [email protected] " }, { "ID" : 2 , "Email" : " [email protected] " } ] Code language: JSON / JSON with Comments ( json ) Union function code:

union(variables( 'UsersArray' ),variables( 'UsersArray' )) Code language: JavaScript ( javascript ) Result Did You Enjoy This Article? 😺

Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up Questions?

If you have any questions or feedback about Remove Duplicates From Power Automate Array Formula please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. Matthew Devaney Power Automate

Save Docusign Document To SharePoint With Power Automate

Share this

Tagged

Power Automate

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →