cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

getting a property of an abject

Hello!

the question is a silly one, but i am a completely new to MS Flow, json and etc.

How do i access a property of the next structure (the output of Azure AD 'Get group members' action) by expression :

***********************************************************

[
  {
    "@odata.type""#microsoft.graph.user",
    "id""f6b59c03-40a3-4a98-85eb-12daef04c78f",
    "businessPhones": [
      "3151"
    ],
    "displayName""Valentin Chernobuk",
    "givenName""Valentin",
    "jobTitle""Закупщик",
    "mail""Valentin.Chernobuk@velait.kz",
    "mobilePhone"null,
    "officeLocation""the address",
    "preferredLanguage"null,
    "surname""Chernobuk",
    "userPrincipalName""Valentin.Chernobuk@testdomain.com"
  }
]
********************************************************
?
I understand it should be done this way: body('Get group members').pointingArrayItem.property. But could anybody suggest the exact suntax?
Thank in advance!
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Frequent Visitor

Re: getting a property of an abject

Hello, @v-yamao-msft.

 

Thank you for your reply.

The goal was to get properties of the first member, but not of all of them.

I did it this way: 

first(array(body('getITAssetManager')))?.userPrincipalName
 
Regards, Alexey

View solution in original post

Highlighted
Community Support
Community Support

Re: getting a property of an abject

Hi @AlexoID,

 

Thanks for updating.

To get the first member in the group, please try the following way.

Initialize variable Test, Type set as Array. Then in the action set variable, Value set as dynamic content Group members.

Add a Compose action, use the following code to get the first member in the group:

first(variables('Test'))?['DisplayName']

Images for your reference:

1.PNG2.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: getting a property of an abject

Hi @AlexoID,

 

Do you want to get displayname, mail, etc. of group members from the action Get group members?

Why not using the dynamic contents of this action?

I have made a flow likes below. It is triggered by Button, then Get group members.

Following by the action Send an email, then I can select dynamic contents from the action Get group members for the email Body.

A screenshot for your reference:

 1.PNG

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: getting a property of an abject

Hello, @v-yamao-msft.

 

Thank you for your reply.

The goal was to get properties of the first member, but not of all of them.

I did it this way: 

first(array(body('getITAssetManager')))?.userPrincipalName
 
Regards, Alexey

View solution in original post

Highlighted
Community Support
Community Support

Re: getting a property of an abject

Hi @AlexoID,

 

Thanks for updating.

To get the first member in the group, please try the following way.

Initialize variable Test, Type set as Array. Then in the action set variable, Value set as dynamic content Group members.

Add a Compose action, use the following code to get the first member in the group:

first(variables('Test'))?['DisplayName']

Images for your reference:

1.PNG2.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Top Kudoed Authors
Users online (6,705)