cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlexoID
Level: Powered On

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
AlexoID
Level: Powered On

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

Community Support Team
Community Support Team

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
Community Support Team
Community Support Team

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.
AlexoID
Level: Powered On

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

Community Support Team
Community Support Team

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
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 4 members 4,752 guests
Please welcome our newest community members: