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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,997)