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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Comparing elements of ...
Power Automate
Answered

Comparing elements of two string arrays

(0) ShareShare
ReportReport
Posted on by

Hello Flow Community!

 

I would like to "compare" elements in two arrays, like eg.:

 

Array1 ["apple", "orange", "banana"];

Array2 ["strawberry", "apple", "watermelon"];

 

the thing is that if at least one element (string) is the same in both arrays i would like to eg. send a message.

 

Did anyone tried something like this, or could give me some hints how to achieve that? 

 

Thanks in advance! 

Categories:
I have the same question (0)
  • Verified answer
    v-bacao-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    If this comparison does not consider index, but if it has the same element value, it need to send email. You could refer to the following method.

     

    • Initialize three variables, two array variables to store the array to be compared, and the integer variable to record how many equal element values.
    • Iterate through the array 1 and determine if array 2 contains the elements in array 1 that are currently traversed. If they are equal, the value of the integer variable is incremented by 1.
    • Finally, determine whether the value of integer is equal to 0. If it is not equal to 0, it means that the two elements have the same elements.

     

    Image reference:37.PNG

    38.PNG39.PNG

     

    Hope it helps.

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-bacao-msft 

     

    It works and that is exactly what i was looking for 🙂 

     

    Thank you vary much!

  • sscarcella Profile Picture
    239 on at

    I have tried this method to compare two arrays and if the item doesnt exist in the second list to create it but when I run it again it creates all the items in the array again not just the new item.

     

    Is there a way to loop through all the items and just create the new items?  I will also want to update if there is something changed...

     

    I am trying to do a one way sync with Azure SQL table to sharepoint online list.

  • pvlvsk Profile Picture
    3 on at

    HI!

    In the list Share Point I have two columns start date and end date, how do I create an array with dates between these two dates?  

    *I want to count whether it coincides with the list of public holidays to calculate the number of vacation days without holidays.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard