Skip to main content
3 of 3
added 1747 characters in body
Matiur Rahman
  • 2.7k
  • 2
  • 7
  • 8

Here are the steps and a sample Power Automate you can use to suit your need.

  1. Get all the SPO groups (Id, Title) using [Send an HTTP request to SharePoint]
  2. Use [Parse JSON] to convert output (body) from step 1 to easily readable properties
  3. Use [Apply to each] to process each group and then retrieve users for that group by using another [Send an HTTP..]
  4. Use another [Apply to each] within the previous one to process each user
  5. Use [Parse JSON] to convert user object to easily readable properties
  6. Store Group Name, User Title and Email in variables and then append those to an array variable
  7. Create a CSV table using [Create CSV table] action with the data stored in the array variable

enter image description here

Detail 1

enter image description here

Detail 2

enter image description here

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

enter image description here

Detail 4

enter image description here

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"
                        ]
                    }
                }
            }
        }
    }
}

enter image description here

Matiur Rahman
  • 2.7k
  • 2
  • 7
  • 8