Skip to main content

Notifications

Power Automate - Building Flows
Unanswered

Export CSV - Security Group Members

Posted on by

I love Power Automate, but always fall down when it comes to manipulating the outputs and on this occasion exporting to a CSV file.

If I run AzureAD - Get Group Members, I get the following output:

 

{
"statusCode": 200,
"headers": {
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding",
"Strict-Transport-Security": "max-age=31536000",
"request-id": "a15f41fb-8dc4-4d39-9b64-e75b31a24863",
"client-request-id": "a15f41fb-8dc4-4d39-9b62-e75b33a24863",
"x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"Australia Southeast\",\"Slice\":\"E\",\"Ring\":\"4\",\"ScaleUnit\":\"002\",\"RoleInstance\":\"ML1PEPF00004AFE\"}}",
"x-ms-resource-unit": "3",
"OData-Version": "4.0",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "false",
"Cache-Control": "no-cache",
"Date": "Mon, 20 Dec 2021 21:22:20 GMT",
"Content-Type": "application/json",
"Content-Length": "52302"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects",
"@odata.nextLink": "https://australia-001.azure-apim.net/apim/azuread/shared-azuread-25567843-72eb-4b47-9eea-130b-094698658/v1.0/groups/b8930af3-4173-4b7c-85f9-7c42a5b23d95/members?$skiptoken=RFNwdAoAAQAAAAAAAAAAFAAAAMWUO1238cFDqxkW13aLwY4BAAAAAAAAAAAAAAAABBAXMS4yLjg0MC4xMTM1NTYuMS40LjKzMzEGAAAAAAABHrYQ7DvLh0KLdUCZMDGpgQFCAAAAAQMAAAA",
"value": [
{
"@odata.type": "#microsoft.graph.user",
"id": "6c6f0c15-4548-4a07-aaaa-656fd31234",
"businessPhones": [
"+1234567"
],
"displayName": "Name Name",
"givenName": "Name",
"jobTitle": "PowerAutomate",
"mail": "name.name@name.com",
"mobilePhone": "123456789",
"surname": "Name",
"userPrincipalName": "name.name@name.com"
}

 

I'm unable to pass this to create a CSV table, even if I add a parse JSON file I still am unable to select the individual properties. Please can someone lend assistance in manipulating the data types and get it to a point where I can export as CSV please?

  • Re: Export CSV - Security Group Members

    Thank you very much @ekarim2020 , I have it sorted! Appreciate you responding

  • EKarim Profile Picture
    EKarim 10,290 on at
    Re: Export CSV - Security Group Members

     Using Search for users and Filter array:

    2021-12-21_22-11-18.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • EKarim Profile Picture
    EKarim 10,290 on at
    Re: Export CSV - Security Group Members

    One method is to use the Filter Array action, filtering on the userPrincipalName property as the example below illustrates:

    2021-12-21_21-56-10.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

  • Re: Export CSV - Security Group Members

    Thank you for this! As I posted this thread, I then revisited the flow and saw this option. 

     

    If I needed to use the Get User Profile v2 for O365 connector, skipping the Get Group Members flow. What syntax is used to construct the search criteria for users with one particular domain UPN

  • EKarim Profile Picture
    EKarim 10,290 on at
    Re: Export CSV - Security Group Members

    Try using the Create CSV table action using Dynamic content:

    2021-12-20_21-49-30.png

     

    Then create the CSV file using the output of the Create CSV table action:

    2021-12-20_21-58-41.png

     

    Sample runtime output:

    2021-12-20_22-01-36.png


    Ellis
    ____________________________________
    If I have answered your question, please mark the post as Solved.
    If you like my response, please give it a Thumbs Up.

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,591

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,090

Leaderboard