cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Kudo Kingpin
Kudo Kingpin

get properties of Person or Group field into variables in a formula/expression

We are retrieving the Line Manager from a SharePoint list using Get Items.

 

That field is defined in the list as Person or Group

 

We know that there will only ever be one line manager in the record...but because it's a person or Group field it's necessary to use Apply to each in flow to retrieve the Line Manager

 

What I would like to do is something like this:

 

first(triggerBody()?['LineManager'])

 

 

We need to get the DisplayName and the Email - how could we do that?

 

But the value we get out is:

 

 

{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser","Claims":"i:0#.f|membership|name@web.uk","DisplayName":"fName  lName","Email":"name@web.org.uk","Picture":"https://bhfonline.sharepoint.com/teams-and-projects/dev/lab/FinanceSystems_ExpenSys/_layouts/15/UserPhoto.aspx?Size=L&AccountName=halperna@bhf.org.uk","Department":"Development Team","JobTitle":"Developer"}

 

 

so how can we extract the DisplayName and Email from that result?

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi

The result you are getting is an object with its properties (property name : value) separated by commas.

 

 

first(triggerBody()?['LineManager'])?['NAmeOfThePropertyYouWantToGet']

 

 

makes the magic. THe ones you are requesting are

 

 

first(triggerBody()?['LineManager'])?['DisplayName']
first(triggerBody()?['LineManager'])?['Email']

 

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

1 REPLY 1
efialttes
Super User
Super User

Hi

The result you are getting is an object with its properties (property name : value) separated by commas.

 

 

first(triggerBody()?['LineManager'])?['NAmeOfThePropertyYouWantToGet']

 

 

makes the magic. THe ones you are requesting are

 

 

first(triggerBody()?['LineManager'])?['DisplayName']
first(triggerBody()?['LineManager'])?['Email']

 

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,123)