Yes, It's feasible using Power Automate.
Please follow below steps to do:
#1. Set the Power Automate trigger - Manually - If it's one time job and if you want delete the item daily basis then flow trigger should be scheduled. As per your requirement you can add.
For below example i have used manually trigger.
#2. Add the SharePoint Get Items action
- Select the SharePoint Site and list - where from you want to delete the data.
#3. Add the Select action
From: Select the Value from Previous action output.
#4. Add compose action to find the unique value from previous action.
Expression:
union(body('Select_|_Unique_ID'),body('Select_|_Unique_ID'))
Note:
body('Select_|_Unique_ID') - Previous action name - If your previous action name is different then please use accordingly.
#5. Add Apply to each loop action
Select an output from previous steps - Select unique action compose that we have created before
#6. Add Filter Array action for comparison
From - Select the Get Item from SharePoint list action value -that we have from #2 step.
Select unique ID column and compare with current item
#7. Add condition action for check how many records we got based on above filter. If length is greater than 1 we need to perform delete operation for this item.
Expression:
length(body('Filter_array_|_Unique_ID_Comparision'))
Note: On length expression select the filter array body output in Expression.
#8. Add Apply to each action inside the condition yes Part.
Apply to each loop action:
Select an output from previous steps: Put below expreesion if you followed same naming conversation else inside the skip use filter array body action output that we have added in step #6.
Expression:
skip(body('Filter_array_|_Unique_ID_Comparision'),1)
#9. Add delete action inside the apply to each as mentioned in above screen shot and select the SharePoint Site and List name from where you wants to delete the data.
ID property put below action:
Note: Make sure to follow same naming conversation of action to avoid the issue in expression.
If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
---------------------------------------------------------------------------------
📩 Need more help? Just mention @Kalathiya and I’ll be happy to assist.
✔️ If this answer helped you, please tick “Does this answer your question?” so it can be marked as the Verified Answer.
💛 A Like always motivates me to keep contributing!