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 Automate
Suggested Answer

Compare 2 arrays

(1) ShareShare
ReportReport
Posted on by 11
Hi
 
I have created 2 arrays, 1 from flagged emails in a shared inbox and 1 from the tasks in a Teams planner
 
basically I would like to cycle through the emails array and compare the subject of each one to the titles of all the tasks in the panner.
 
If there is a match, skip, if there is no match, create a new task with the title being the subject of the email
 
I tried nested Apply to each but seems to cycle around creating duplicate tasks
 
Is there a straightforward way to do this?
 
Thanks!
Categories:
I have the same question (0)
  • Suggested answer
    Expiscornovus Profile Picture
    33,891 Most Valuable Professional on at
     
    Yes, you could compare two arrays with a filter array action to find the exceptions which don't have a match. After that you can use the outputs of that action in a apply to each loop to create new tasks for those non-matched items.
     
    @DamoBird365 has created a nice blog about this approach (specifically have a look at the Except section).
    https://damobird365.com/efficien-union-except-and-intersect-great-method/

    If you need additional help/have questions about your use case setup let us know.
     
     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
  • DA-20021519-0 Profile Picture
    11 on at
    Hi
     
    Thanks for the reply, that looks really interesting
     
    When I set up the Filter Array action, PA automatically adds in a 'For each' for each flagged email so if there are say, 3 flagged emails it cycles around 3 times and created 3 tasks for every email, i was just expecting the Filter Array to just produce another array which I could process
     
    Would you know how I could fix that?
     
    Many thanks!
  • Expiscornovus Profile Picture
    33,891 Most Valuable Professional on at
     
    Can you share a screenshot of your current flow setup?
     
    This makes a bit easier to create an example for your setup/give you some pointers into the right direction.
     
     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
     
     
  • DA-20021519-0 Profile Picture
    11 on at
    That's super helpful, thank you
     
    This is what I am using to make the 2 arrays to compare
     
    The Init Variables are not used
     
    Many thanks!
     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard