cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sevket
Helper I
Helper I

"Except" Operation in Flow

Hi guys,

 

I'm just stuck and would appreciate your help.

 

I have two Sharepoint lists where I loop through and for each one I create an array (variable) with user IDs.

Let's say array A stores (all possible) 10 IDs and array B contains 7 IDs.

What I would like to get is a third array C where all IDs from array A are stored which are NOT in array B (in this case C would have 3 entries).

Is this possible without creating a for-each loop with another for-each loop inside.

 

I also tried one loop with the filter array action without any luck.

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @Sevket ,

 

Please refer to screenshot below to create the flow:

1.png2.png3.png 

The flow would run successfully as below:

4.png

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Gristy
Resident Rockstar
Resident Rockstar

loop array b

use the filter array action

in the outputs if there is any add to array c

v-alzhan-msft
Community Support
Community Support

Hi @Sevket ,

 

Please refer to screenshot below to create the flow:

1.png2.png3.png 

The flow would run successfully as below:

4.png

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-alzhan-msft , 

Is there any other way to do an Except action? Doing a double Apply-to-each is non-intuitive. Also, I believe you'd have to perform another Apply-to-Each loop to determine which unique values are in the OTHER table.

Just like we have Intersection and Union, we need Except. 

Example:

  • Given two arrays, show which items exist in one and not the other

This post has a nice example of Except: https://powerusers.microsoft.com/t5/Power-Automate-Ideas/Except-operation-in-WDL/idi-p/423351#M17791

Hi @ericonline ,

 

Have you made a test on it?

 

Best regards,

Alice       

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (6,251)