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 / Joining/Merging Arrays
Power Automate
Unanswered

Joining/Merging Arrays

(0) ShareShare
ReportReport
Posted on by 55

Hello!

I have two SharePoints that I am trying to Join/Merge in PowerAutomate: SP1 1 with the full list of vehicles & SP 2 with inspection times. Both share the same data in "Title." The inspections SP has a column called "Time"

 

Currently I have:

Get Items (gets items from SP1)

Get Items 2 (gets items from SP2)

Select (called Select-Inspection-Times)

  • From = 

 

Outputs('Get_Items_2')?['body/value']​

 

  • Map = 

 

concat('"',item()?['Title'],'":',item())​

 

Compose

  • Inputs = 

 

json(concat('{',join(body('Select-Inspection-Times'),','),'}'))​

 

Select

  • From = 

 

Outputs('Get_Items')?['body/value']​

 

  • Map =
    • Vehicle = 

 

item()?['Title']​

 

  • Inspection Time = 

 

outputs('Compose')?[string(item()?['Title'])]?['Time']​

 

Currently, I am getting the correct data, but only the first iteration. So if I have in SP1:

  • A
  • B
  • C

and in SP 2:

  • A - 9:00
  • A - 10:00
  • B - 8:00

When I run the flow I get:

 

[
 {
 "Vehicle": "A",
 "Inspection Time": "9:00"
 },
 {
 "Vehicle": "B",
 "Inspection Time": "8:00"
 },
 {
 "Vehicle": "C",
 "Inspection Time": null
 }
] 

 

I am hoping to be able to get something that looks like: 

 

[
 {
 "Vehicle": "A",
 "Inspection Time": "9:00, 10:00"
 },
 {
 "Vehicle": "B",
 "Inspection Time": "8:00"
 },
 {
 "Vehicle": "C",
 "Inspection Time": null
 }
] 

 

Any suggestions on what I need to do to get there? I feel like I'm close, but I can't get it to run with more than 1 iteration of each. 

Thanks!

Categories:
I have the same question (0)
  • Nived_Nambiar Profile Picture
    18,136 Super User 2026 Season 1 on at

    Hi @dsopshin 

     

    Your current code seems to taking first Inspection time entry, let's make the flow design little bit simpler

     

    Consider this is the vehicle list

    Nived_Nambiar_0-1716749270846.png

     

    Consider this as inspection list

    Nived_Nambiar_1-1716749309925.png

     

     

    Now let's go to flow design

     

    1. Get items from vehicle list

    Nived_Nambiar_2-1716749349688.png

     

    2. Select only Title column from the vehicle list using select action

    Nived_Nambiar_3-1716749417823.png

     

    3. get items from Inspection list

    Nived_Nambiar_4-1716749443288.png

     

    4. Select the title and Inspection Time column values from output of Get items of Inspection List

    Nived_Nambiar_5-1716749509028.png

     

    5. Use compose action to create an array structure like below

    Nived_Nambiar_6-1716749550068.png

     

     

    6. use select action to map each vehicle to its inspection timings (as required per output)

    Nived_Nambiar_7-1716749626466.png

     

    Nived_Nambiar_8-1716749645497.png

     

    Nived_Nambiar_11-1716749823988.png

     

     

    Expression - 

    if(empty(join(xpath(xml(outputs('Compose')),concat('//data[Title="',item(),'"]/InspectionTime/text()')),',')),null,join(xpath(xml(outputs('Compose')),concat('//data[Title="',item(),'"]/InspectionTime/text()')),','))
     
    Now see the result-
     

    Nived_Nambiar_12-1716749876326.png

     

     

    Hope it helps !

    Thanks & Regards,

    Nived N 🚀

    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs

    🔍 Found my answer helpful? Please consider marking it as the solution!
    Your appreciation keeps me motivated. Thank you! 🙌

     

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 58

#2
David_MA Profile Picture

David_MA 53 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 36 Most Valuable Professional

Last 30 days Overall leaderboard