web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / What would an alternat...
Power Automate
Unanswered

What would an alternative to JavaScript's Reduce() be in Power Automate?

(1) ShareShare
ReportReport
Posted on by 578

I'm fetching list items from a very simple SharePoint List using Get Items. 

 

List:

 

Annotation 2020-12-22 162028.jpg

 

I can pull the data without any issues, and I get the JSON.

II.jpg

 

The output is:

 

 

 

[
 {
 "State": "NY",
 "Person": "James"
 },
 {
 "State": "NY",
 "Person": "Kurt"
 },
 {
 "State": "SC",
 "Person": "Jose"
 },
 {
 "State": "SC",
 "Person": "John"
 },
 {
 "State": "MD",
 "Person": "Paul"
 },
 {
 "State": "FL",
 "Person": "Pedro"
 },
 {
 "State": "WA",
 "Person": "Jeane"
 }
]

 

 

 

 

I tried to use Union() to find duplicates with a Compose using union(body('Get_Data'),body('Get_Data')), but the output is exactly the same. How can I achieve the desired JSON grouping items from the same State as shown below using Power Automate?

 

 

 

{
	"NY": [{
		"State": "NY",
		"Person": "James"
	}, {
		"State": "NY",
		"Person": "Kurt"
	}],
	"SC": [{
		"State": "SC",
		"Person": "Jose"
	}, {
		"State": "SC",
		"Person": "John"
	}],
	"MD": [{
		"State": "MD",
		"Person": "Paul"
	}],
	"FL": [{
		"State": "FL",
		"Person": "Pedro"
	}],
	"WA": [{
		"State": "WA",
		"Person": "Jeane"
	}]
}

 

 

 

 

Thanks in advance.

 

 

 

Categories:
  • VictorIvanidze Profile Picture
    13,083 on at

    Hi @emfuentes27 , start here.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 231 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 217 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 170

Last 30 days Overall leaderboard