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 / Removing duplicates in...
Power Automate
Unanswered

Removing duplicates in Dataverse through Union

(0) ShareShare
ReportReport
Posted on by
I am trying to make a power automate workflow that goes through a Dataverse table called "Visa Status". in this table, i have Student ID and Visa Update Date columns. i want the automate flow to check if Student ID and Visa Update Date are the same, then consider them duplicate and remove. Currently, the approach I am trying is:

1. Initialize Variables:
- Initialize 'Records' array variable (Type: Array)
- Initialize 'DuplicateRecords' array variable (Type: Array)
- Initialize 'currentKey' variable (Type: String)

2. Get Records:
List rows from Visa Status table

3. Apply to Each (Process all records):
For each row in Visa Status table
{
// Update currentKey variable with combined values
Set Variable: currentKey = concat(row['crdcb_StudentID'], row['crdcb_VisaUpdateDate'])

// Check if combination exists in Records array
Condition: if contains(variables('Records'), variables('currentKey'))
{
Yes:
{
// Add to duplicates array
Append to Array: DuplicateRecords
Add row ID to remove later
}
No:
{
// Add to processed records
Append to Array: Records
Add variables('currentKey')
}
}
}

4. Remove Duplicates:
Apply to Each (DuplicateRecords)
{
// Delete row from Dataverse
Delete row
Table: Visa Status
Row ID: current item
}

However, i keep facing errors. Is there a simpler approach for this?
Categories:
I have the same question (0)
  • Suggested answer
    CA1105 Profile Picture
    545 Super User 2025 Season 2 on at
    Removing duplicates in Dataverse through Union
     In your apply to each action you can add condition action and then both the conditions like Student_ID= row['crdcb_StudentID'] and VisaUpdateDate=row['crdcb_VisaUpdateDate']. If true Delete row.
  • Suggested answer
    takolota1 Profile Picture
    4,974 Moderator on at
    Removing duplicates in Dataverse through Union
    You can also use this template to efficiently find & remove duplicates https://community.powerplatform.com/galleries/gallery-posts/?postid=ad474d7b-9cf5-492c-97c4-0a68d3597aad

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