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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

(sorry) Trivial Post! - Need this array value as a string

(0) ShareShare
ReportReport
Posted on by

I call a http request to GraphAPI and return a list of the security groups a user is a member off. I only need to select the group type and the group ID. 

The output is this:

{
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(groupTypes,id)",
"value": [
{
"@odata.type": "#microsoft.graph.group",
"groupTypes": [
"DynamicMembership"
],
"id": "badc0e9e-d736-4534-b2c2-7aed3280a035"
},
{
"@odata.type": "#microsoft.graph.group",
"groupTypes": [
"Unified"
],
"id": "14a7c19e-db29-4e5c-82ec-657686b5f27d"
},
{
"@odata.type": "#microsoft.graph.group",
"groupTypes": [
"Unified"
],
"id": "1b8d728a-bf51-4ddd-b167-9e945f734d77"
}
]
}
}

 

If I PARSE the output on body, I can return the ID as a string in a compose activity. What throws me is groupTypes returns in a single array 

[

"DynamicMembership"

]

 

How do I go about retrieving the string DynamicMembership please?

 

 

I have the same question (0)
  • Rhiassuring Profile Picture
    8,690 Moderator on at
    Re: (sorry) Trivial Post! - Need this array value as a string

    Nothing is ever trivial when it comes to flow...

     

    So you're only asking how to get the string out of that last thing you posted?

     

    variables('arrGroup')[0]
     
    (Where variables('arrGroup') is whatever is holding your single item there.) 

    The [0] just says "take the thing that's at an index of 0 in this array."
     
    You could also use first(variables('arrGroup'))
     
    Whatever floats your boat.
  • LW-28112008-0 Profile Picture
    on at
    Re: (sorry) Trivial Post! - Need this array value as a string

    Thank you! 

    Your reply pointed me in the right direction and I sorted it..

    regards

  • LW-28112008-0 Profile Picture
    on at
    Re: (sorry) Trivial Post! - Need this array value as a string

    Still doesn't work 100%, only the first ([0]) is being returned. 

    Maybe I'll expand the question and ask, how do I parse the following to get the ID and the GroupType only. 

     

    {
     "body": {
     "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#directoryObjects(groupTypes,id)",
     "value": [
     {
     "@odata.type": "#microsoft.graph.group",
     "groupTypes": [
     "DynamicMembership"
     ],
     "id": "badc0e9e-d736-4534-b2c2-7aed3280a035"
     },
     {
     "@odata.type": "#microsoft.graph.group",
     "groupTypes": [
     "Unified"
     ],
     "id": "14a7c19e-db29-4e5c-82ec-657686b5f27d"
     },
     {
     "@odata.type": "#microsoft.graph.group",
     "groupTypes": [
     "Unified"
     ],
     "id": "1b8d728a-bf51-4ddd-b167-9e945f734d77"
     }
     ]
     }
    }
    

     

  • VictorIvanidze Profile Picture
    13,054 on at
    Re: (sorry) Trivial Post! - Need this array value as a string

    Use Select action.

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 532 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 461 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 256

Last 30 days Overall leaderboard