web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to extract multi-p...
Power Automate
Suggested Answer

How to extract multi-person SharePoint field to a single comma-separated string in Power Automate

(0) ShareShare
ReportReport
Posted on by 36

Hi all,

 

I have a SharePoint list with a multi-person field called Assigned. Using Power Automate, I want to retrieve several fields from the list:

  • ItemInternalId
  • Title
  • Assigned (multi-person)
  • TitleCategorizationforAI
 

My goal is to produce a clean JSON object like this for each item:

{
"ItemInternalId": 1,
"Title": "Test",
"Assigned": "user1@domain.com, user2@domain.com",
"TitleCategorizationforAI": "Some text"
}
 

The problem is that the Assigned field is an array of objects, and Power Automate does not allow expressions like:
first(body('Get_items')?['value'])?['Assigned']?['Email']
or map() or join() directly — I always get errors like:
Array elements can only be selected using an integer index
Is there a way to flatten / extract multi-person fields into a single comma-separated string without using Apply to Each?
Any suggestions or workarounds would be greatly appreciated.

then i will insert this json in a run a prompt and ai will produce a json like this that will insert items in another list. the other list has also Assigned with multi select. 






 

Thanks in advance!

Categories:
I have the same question (0)
  • Suggested answer
    chiaraalina Profile Picture
    1,929 Super User 2026 Season 1 on at
    Hi
     
    I assume already have an outer Apply to each over body('Get_items')?['value']. So you can flatten by doing this:
     
    Inside your loop use Select action from Data Operations. 
    From: item()?['Assigned']
    Map (leave the key name blank, just the value): item()?['Email']
     
    This converts the array of user objects into an array of email strings.
     
    I assumed your internal name of the column is Assigned.

    Then use a Compose action and add join(body('Select'), ', ').

     
  • giorgiokatr Profile Picture
    36 on at
    thanks !! so my out from ai is like this 

    { "title": "something", "category": "something", "assignedTo": "test@test.com,test1@test.com", "catid": "4" }

    now i use create items in another list
    this list has assignedTo column with multiple fields. how to enter both email?
  • chiaraalina Profile Picture
    1,929 Super User 2026 Season 1 on at
    What type of field is it the assignedTo? Is it multi-person or string?
  • giorgiokatr Profile Picture
    36 on at
    it is multi person
  • chiaraalina Profile Picture
    1,929 Super User 2026 Season 1 on at
    Ok, format of multi-person is this:
     
    [
      { "Claims": "i:0#.f|membership|test@test.com" },
      { "Claims": "i:0#.f|membership|test1@test.com" }
    ]
     
    So you have to bring it to this form.
     
    You can split the out of your AI action to an array.
    split(body('Parse_AI')?['assignedTo'], ',')
     
    Use a compose and please adjust. You should receive an array like this:
    [
      "test@test.com",
      "test1@test.com"
    ]
     
    Then use a Select action:
    From: outputs('Compose_EmailsArray') (it's your array that you just created)
    Map:
    Left side: Claims and
    right side: concat('i:0#.f|membership|', trim(item()))
     
    Result should be this
    [
      { "Claims": "i:0#.f|membership|test@test.com" },
      { "Claims": "i:0#.f|membership|test1@test.com" }
    ]
     
    Exactly what you can use for multi-person.
  • giorgiokatr Profile Picture
    36 on at

     
    thanks very helpful!
    so to my initial questions
    after get items (gipolookup) i set a apply to each 
    outputs('gipolookup')?['body/value']
    ------------------------
    after a select with 
    item()?['Assigned']
    map blank and item()?['Email']

    ------------------------
    and then a compose 
    join(body('Select_'), ', ')
    after this?
    ​​​​​​​
    ​​​​​​​------------------------
    i added another compose 
    json(concat(
        '{',
            '"ItemInternalId": "', string(items('Apply_to_each')?['ID']), '",',
            '"Title": "', items('Apply_to_each')?['Title'], '",',
            '"Assigned": "', outputs('Compose_Join_Emails'), '",',
            '"TitleCategorizationforAI": "', items('Apply_to_each')?['TitleCategorizationforAI'], '"',
        '}'
    ))
     
    but i get error...

    ​​​​​​​
     
     
     
     
  • chiaraalina Profile Picture
    1,929 Super User 2026 Season 1 on at
    Can you show some screenshorts and provide error message?
  • giorgiokatr Profile Picture
    36 on at
    thanks i managed to create multiperson thank you!
    my last try is to send a more clear json data to run a prompt.
    right now i have a microsoft list get items (it has the data that i sent to run a prompt. then i have i select from this. this select gives me this 

    {
        "Title": "Some title",
        "Assigned": [
            {
                "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                "Claims": "i:0#.f|membership|user1@domain.com",
                "DisplayName": "Χρήστης 1",
                "Email": "user1@domain.com",
                "Picture": "https://domain.com/path/user1-photo",
                "Department": "Τμήμα Α",
                "JobTitle": null
            },
            {
                "@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                "Claims": "i:0#.f|membership|user2@domain.com",
                "DisplayName": "Χρήστης 2",
                "Email": "user2@domain.com",
                "Picture": "https://domain.com/path/user2-photo",
                "Department": "Τμήμα Α",
                "JobTitle": null
            }
        ],
        "ItemInternalId": "1",
        "TitleCategorizationforAI": "Some title description"
    }

    i would like to make it 
    {
        "Title": "Some title",
        "Assigned": [
            {
               
                "Email": "user1@domain.com",
               
            },
            {
               
                "Email": "user2@domain.com",
              
            }
        ],
        "ItemInternalId": "1",
        "TitleCategorizationforAI": "Some title description"
    }
    to send less data to gpt so less tokens
  • giorgiokatr Profile Picture
    36 on at
    right now i have this 

    but i get 21 outputs (21 list rows). how to combine to send a union json to gpt?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 957

#2
Valantis Profile Picture

Valantis 847

#3
Haque Profile Picture

Haque 609

Last 30 days Overall leaderboard