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

Get List items with multi-select person column

Hello, 

I have a SharePoint list with 2 columns:

1 x text field, called Topic

1 person or group column set to multi-select, called Users

 

If I do a Get Items on this and then a Select: 

heywoodheywood_0-1593771044345.png

I get the array back as shown below, with 2 entries, 1 with 1 user and the other with 2 users.

 

 

[
  {
    "Topic": "Topic 1",
    "Users": [
      {
        "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        "Claims": "i:0#.f|membership|user0@xxx.com",
        "DisplayName": "user0",
        "Email": "user0@xxx.com",
        "Picture": "https://xxx.sharepoint.com/sites/xxx/_layouts/15/UserPhoto.aspx?Size=L&AccountName=user0@xxx.com",
        "Department": "1111",
        "JobTitle": "Sales"
      }
    ]
  },
  {
    "Topic": "Topic 2",
    "Users": [
      {
        "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        "Claims": "i:0#.f|membership|user1.com",
        "DisplayName": "user1",
        "Email": "user1@xxx.com",
        "Picture": "https://xxx.sharepoint.com/sites/xxx/_layouts/15/UserPhoto.aspx?Size=L&AccountName=user1@xxx.com",
        "Department": "1111",
        "JobTitle": "Sales"
      },
      {
        "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        "Claims": "i:0#.f|membership|user2@xxx.com",
        "DisplayName": "user2",
        "Email": "user2@xxx.com",
        "Picture": "https://xxx.sharepoint.com/sites/xxx/_layouts/15/UserPhoto.aspx?Size=L&AccountName=user2@xxx.com",
        "Department": "1111",
        "JobTitle": "Sales"
      }
    ]
  }
]

 

 

If you see, there is a lot of extra information coming back with the Person column.

I would like it to come back with jus the user's email, like this:

 

 

[
  {
    "Topic": "Topic 1",
    "Users": [
      {
        "Email": "user0@xxx.com"
      }
    ]
  },
  {
    "Topic": "Topic 2",
    "Users": [
      {
        "Email": "user1@xxx.com"
      },
      {
        "Email": "user2@xxx.com"
      }
    ]
  }
]

 

 

But I can't figure out the syntax on the select for this.

I've tried:

 

item()['Users'].Email

item()['Users']?['Email']

item()['Users']?['Value']?['Email']

 

Plus many others, mostly coming back with:

The template language expression 'item()['Users']['Email']' cannot be evaluated because property 'Email' cannot be selected. Array elements can only be selected using an integer index.

 

Can anyone help?

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @heywoodheywood 

 

Because it's multi-select the results are going to be in arrays. Also other information showing are by design. If you after only a particular property you need to iterate your Get Topic Items. Then inside the loop add a parse JSON and pass the multi-select values, iterate the multi-select json results. Finally construct your own custom array JSON object for the Select step.

 

Have a look at this thread about how to construct your own custom array.

 

https://powerusers.microsoft.com/t5/Building-Flows/converting-sharepoint-document-library-lookup-col...

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

1 REPLY 1
Highlighted
Super User III
Super User III

Hi @heywoodheywood 

 

Because it's multi-select the results are going to be in arrays. Also other information showing are by design. If you after only a particular property you need to iterate your Get Topic Items. Then inside the loop add a parse JSON and pass the multi-select values, iterate the multi-select json results. Finally construct your own custom array JSON object for the Select step.

 

Have a look at this thread about how to construct your own custom array.

 

https://powerusers.microsoft.com/t5/Building-Flows/converting-sharepoint-document-library-lookup-col...

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

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.

Top Solution Authors
Top Kudoed Authors
Users online (8,653)