Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Combine all items from array 1 with each of array 2

(0) ShareShare
ReportReport
Posted on by 13

Hi!

I have two arrays coming from two different sources in the following format:

Array1

 

[
 {
 "Date": "2024-03-14"
 },
 {
 "Date": "2024-03-15"
 }
]

 

 

Array 2

 

[
 {
 "Start": "2024-02-01",
 "End": "2024-05-31",
 "Name": "Event1"
 },
 {
 "Start": "2024-03-05",
 "End": "2024-03-15",
 "Name": "Event2"
 }
]

 

 

What I want to achieve is this:

 

[
 {
 "Date": "2024-03-14"
 "Start": "2024-02-01",
 "End": "2024-05-31",
 "Name": "Event1"
 },
 {
 "Date": "2024-03-14"
 "Start": "2024-03-05",
 "End": "2024-03-15",
 "Name": "Event2"
 },
 {
 "Date": "2024-03-15"
 "Start": "2024-02-01",
 "End": "2024-05-31",
 "Name": "Event1"
 },
 {
 "Date": "2024-03-15"
 "Start": "2024-03-05",
 "End": "2024-03-15",
 "Name": "Event2"
 }
]

 

 

I am not sure what the right terminology is, but I guess I want to duplicate the array 2 by the number of items in array 1. I want to be able to check if each Date from array 1 (there will be a 7 days period each day) is during the period (Start-End) in array 2, and if it is, add to a variable to get a nice html email.

 

I hope it makes sense and someone can help me! Still working on my journey to understand arrays well. Thank you

  • Verified answer
    JeremP Profile Picture
    13 on at
    Re: Combine all items from array 1 with each of array 2

    Oh well. Found.

     

    Apply to each, set string variable with values from Array1, then nested Apply to each (2) to append to array variable, array with string variable and values from Array 2.

     

    Why did it take me two days to figure out.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,658 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow