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?