Skip to main content

Notifications

Community site session details

Community site session details

Session Id : it9ebqWH5a5nNdQ84hPo9m
Power Automate - Building Flows
Answered

Need help filtering arrays with objects

Like (3) ShareShare
ReportReport
Posted on 29 Aug 2024 20:46:14 by 56
I'm working on a flow where I need to be able to detect changes between two arrays with objects. 

varPrevious:
 
[
{"uniqueID": "1111", "FirstName": "John", LastName: "Smith", "Age": "30"} ,
{"uniqueID": "2222", "FirstName": "Peter", LastName: "Paul", "Age": "32"} ,
{"uniqueID": "3333", "FirstName": "Steve", LastName: "Johnson", "Age": "25"} ,
{"uniqueID": "4444", "FirstName": "Randy", LastName: "Moss", "Age": "26"} 
]


varCurrent:
 
[
{"uniqueID": "1111", "FirstName": "John", LastName: "Smith", "Age": "30"} ,
{"uniqueID": "2222", "FirstName": "Peter", LastName: "Paul", "Age": "32"} ,
{"uniqueID": "3333", "FirstName": "Steve", LastName: "Smith", "Age": "25"} ,
{"uniqueID": "5555", "FirstName": "Jerry", LastName: "Rice", "Age": "34"} 
]
 
Given the two arrays I would like to be able to filter out new entries, deleted entries, and modified entries for reporting purposes.
 
End Goal:
New Entries: 
[{"uniqueID": "5555", "FirstName": "Jerry", LastName: "Rice", "Age": "34"} ]
 
Deleted Entries: 
[{"uniqueID": "4444", "FirstName": "Randy", LastName: "Moss", "Age": "26"} ]
 
Modified Entries:
[{"uniqueID": "3333", "FirstName": "Steve", LastName: "Smith", "Age": "25"} ]


I have tried using the filter array action but I can't seem to figure it out. 

 
Output: 
[
{"uniqueID": "3333", "FirstName": "Steve", LastName: "Smith", "Age": "25"} ,
{"uniqueID": "5555", "FirstName": "Jerry", LastName: "Rice", "Age": "34"}
]
 
 
The filter array action above returns the modified object (id:3333) and the new object (id:5555). The same happens when I filter for the deleted object. The filter array action returns the modified object (id:3333) and the deleted object (id:4444).
 
 
Any help would be greatly appreciated.

Thanks
  • Verified answer
    jody1213 Profile Picture
    56 on 30 Aug 2024 at 16:21:51
    Need help filtering arrays with objects
    Please disregard as I was able to figure it out!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 125

#2
David_MA Profile Picture

David_MA 122 Super User 2025 Season 1

#3
Michael E. Gernaey Profile Picture

Michael E. Gernaey 110 Super User 2025 Season 1

Overall leaderboard