
Looking at the issue, I recommend using a two-level loop in Power Automate. The first loop processes each record. The second loop splits and expands each person entry.
split(items('Apply_to_each')?['Person'], ';')
This converts multiple people into an array.
Add a second Apply to each.
{
"ID": items('Apply_to_each')?['ID'],
"Location": items('Apply_to_each')?['Location'],
"Role": trim(last(split(split(trim(item()), '|')[0], ':'))),
"Name": trim(last(split(split(trim(item()), '|')[1], ':'))),
"Email": trim(last(split(split(trim(item()), '|')[2], ':')))
}
This extracts Role, Name, and Email from each segment and creates one clean record.
If the Person string ends with a semicolon, add a Condition before appending.
Condition expression:
greater(length(trim(item())), 0)
Only append when the value is not empty.
Use the Result variable as your final dataset.
You can send it in a response, store it, or generate CSV or JSON output.
You will get one row per person with ID and Location repeated, exactly matching the desired result.