Logo
  • Contact form
  • Events & slides
  • Buy me a snack
👋🏻

Comparing arrays/tables in Power Automate

Table of contents

  • Setup / example
  • The flow
  • Changelog
☝
TL;DR - Comparing tables or arrays in Power Automate should honestly be more simple than it is right now. Maybe its just me making it complex, but here is a way to compare tables or arrays against each other.

Disclaimer: This method only works if you have a unique property to compare on. In the sample below its the E-Mail.

Setup / example

We will use two arrays:

  1. A list of members from a group in Entra ID
  2. A list of items from SharePoint containing users. The list contains two columns called FullName and Account.
👉

For this scenario we will not have more than 999 members in the Entra ID group and not more than 5000 items in the SPO list. The group is our leading table, the Sharepoint list the child.

The SPO list is supposed to be synced with the group members and therefore, updated regularly. That means that we need to check for:

  1. Group members that are missing from the SharePoint list and need to be added
  2. Group members that were removed, but are still in the SharePoint list and need to be removed

The flow

We will use the Filter array action to filter out what we needs to be added and what needs to be removed.

To figure out which items need to be added we essentially ask “From the leading table, which item is not in the child table”.

To figure out which items need to be removed we essentially ask “From the child table, which item is not in the leading table.”

🚨

Please be aware of the action names I used here if you simply copy and paste all expressions.

‣
This is a screenshot of the complete flow
  1. Create a new flow and choose the trigger you need. In my case I will simple add a manual trigger.
  2. Add a Get items action and configure it for the site and list you are storing the users in
    1. In this action navigate to Settings, enable Pagination and enter 5000 into the Threshold box
  3. Add a Select action. The select action will transform the get items output to a “flat” value list of emails. We will use this and the emails for the comparison. Configure:
    1. From: outputs('Get_items_-_users')?['body/value']
    2. Map: item()?['Account/Email']
    3. image
  4. Add a List group members action, either after or in parallel to the Get items action.
  5. Add a second Select action. The select action will transform the list group members output to a “flat” value list of emails. We will use this and the emails for the comparison. Configure:
    1. From: outputs('List_group_members')?['body/value']
    2. Map: item()?['mail']
    3. image
  6. Next, we will check what items from the group need to be added to the list.
  7. Add a Filter array action. The filter in easy words: From the list group members, which members email is not in the SharePoint list (from the select action). Configure:
    1. From: outputs('List_group_members')?['body/value']
    2. Filter Query: body('Select_-_only_emails_from_list') does not contain item()?['mail']
    3. image
  8. Based on the body (result) of that filter, use apply to each and create the item in your list.
  9. image
  10. Finally, we will check whats items need to be deleted from the list as the item was removed from the group.
  11. Add a second Filter array action. The filter easy words: From the SharePoint list, what items exist, but does not exist in the list group members anymore (from select action). Configure:
    1. From: outputs('Get_items_-_users')?['body/value']
    2. Filter Query: body('Select_-_only_emails_from_group') does not contain item()?['Account/Email']
    3. image
  12. Based on the body (result) of that filter, use apply to each and remove or update the item in your list.
  13. image

Changelog

Date
Changes
25.09.2025
Initial version
29.12.2025
Added note about comparing numbers or Ids.

Thanks for reading! 💕

Logo

Events & slides

Buy me a snack

Contact form

Data privacy policy

About

This blog is made with ♥️ on Notion and made public with Super.so. Rocket icon created by RIkas Dzihab - Flaticon.

RedditLinkedIn