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 / DIY Custom Connector g...
Power Automate
Unanswered

DIY Custom Connector gives the difference between two arrays. Set difference A/B

(2) ShareShare
ReportReport
Posted on by 7
Tried posting this yesterday, seems like it didn't work, so here we go again :)
 
I've been working in the whole Power Platform environment for a year now, mainly Power Automate, and in that context I've been missing an 'Except' function to complement the 'Intersection' and 'Union', as the more naive ways of getting the difference between 2 sets / arrays / lists are slow as I can see from the many posts inhere indicates a lot of you already know!
 
So I made a Custom Connector that can take 2 arrays, e.g. array 'A' and array 'B', and output the elements of 'A' that aren't also present in 'B'. So if A = [1, 2, 3, 4} and B = [2, 4, 6, 8], the output will be [1, 3].
 
So, first I got the functionality working for an array of numbers and strings respectively, and after that I got it working for JSON objects, so it's possible to input arrays 'A' and 'B' like before, but now you also need to specify the fields it's comparing, e.g. 'ownerid' from 'A' and 'systemuserid' from 'B'.
 


I'm fresh out of "programmning school" last summer, and working as the first developer in a company, so I don't have any senior devs or similar to lean on, so there's probably some finishing touches left to make it really "premium", but none the less, I wanna share it with you as I find it really helpful myself.
 
As for speed of the comparison - I threw a list of approx. 13k json objects and another with approx. 8k json objects at it, and had it compare guids, and it took less than a second for it to finish!
 
Here's the swagger.json and script.cs in an open GitHub repos -> Custom Connector
I tried making the README as detailed as possible.
 
Basically, go to your Power Automate > Custom connectors > New custom connector > Import from an OpenAPI file > add the swagger file > wait for it to finish > go to '4. Code' and enable code, select all 3 actions and add the C# script > Create connector.... and you're ready to go :)
 
 
Hope it helps!
I have the same question (0)
  • Vahid Ghafarpour Profile Picture
    795 Super User 2026 Season 1 on at
    Great work on this, it's a genuinely useful connector, and the performance numbers you shared (13k vs 8k JSON objects in under a second) are impressive.
    I had problem with the native except() function when want to compare array A by ownerid against array B by systemuserid.

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 605

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard