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
Highlighted
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.
Highlighted
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

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,681)