Here are the steps and a sample Power Automate you can use to suit your need.
- Get all the SPO groups (Id, Title) using [Send an HTTP request to SharePoint]
- Use [Parse JSON] to convert output (body) from step 1 to easily readable properties
- Use [Apply to each] to process each group and then retrieve users for that group by using another [Send an HTTP..]
- Use another [Apply to each] within the previous one to process each user
- Use [Parse JSON] to convert user object to easily readable properties
- Store Group Name, User Title and Email in variables and then append those to an array variable
- Create a CSV table using [Create CSV table] action with the data stored in the array variable
Detail 1
Detail 2
Parse JSON Schema for gorups (Id and Title)
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"Id": {
"type": "integer"
},
"Title": {
"type": "string"
}
},
"required": [
"__metadata",
"Id",
"Title"
]
}
}
}
}
}
}
Detail 3
Detail 4
Schema used in Parse JSON for each user
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"results": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Title": {
"type": "string"
},
"Email": {
"type": "string"
}
},
"required": [
"Title",
"Email"
]
}
}
}
}
}
}