cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlexoID
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

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

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
v-yamao-msft
Community Support
Community Support

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.

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

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,874)