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 Automate - Building Flows
Suggested answer

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?
I have the same question (0)
  • Suggested answer
    CA1105 Profile Picture
    515 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,946 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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 555 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 388 Moderator

#3
chiaraalina Profile Picture

chiaraalina 264

Last 30 days Overall leaderboard