I'm fetching list items from a very simple SharePoint List using Get Items.
List:
I can pull the data without any issues, and I get the JSON.
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.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
34 | |
15 | |
15 | |
13 | |
7 |
User | Count |
---|---|
41 | |
31 | |
25 | |
11 | |
11 |