cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
crf200
Advocate IV
Advocate IV

Apply to Each Collection without Duplicates

I'm trying to build a flow that pulls items from a sharepoint list with an odata filter applied.

 

I want to take a field from the json and create a list of values without duplicates.

 

I've tried creating an 'Apply to each' with a 'Compose' to return the integer inside the field I'm wanting from each record.

 

Now I'm trying to take all the integers from the 'Apply to each' and put them in a list without duplicates.

 

Is there a way to collect the values resulting from an 'Apply to each'? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bacao-msft
Community Support
Community Support

Hi @crf200,

 

Could you share more details about your needs?

Could you provide a full screenshot of your Flow configuration? Includes detailed configuration and details about the list.

It seems that you want to store the integer in the field contained in the filtered item in a collection.

And need to remove the duplicate integer.

You could store these integers by adding array variables and use the union() function to remove duplicate elements from the array.

Expression:

 

union(variables('Integer'),variables('Integer'))

 

Image reference:

16.PNG

18.PNG17.PNG

Please take a try or provide more details.

Best Regards,

 

Community Support Team _ Barry
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

6 REPLIES 6
crf200
Advocate IV
Advocate IV

ATE Missing List.jpg

 

v-bacao-msft
Community Support
Community Support

Hi @crf200,

 

Could you share more details about your needs?

Could you provide a full screenshot of your Flow configuration? Includes detailed configuration and details about the list.

It seems that you want to store the integer in the field contained in the filtered item in a collection.

And need to remove the duplicate integer.

You could store these integers by adding array variables and use the union() function to remove duplicate elements from the array.

Expression:

 

union(variables('Integer'),variables('Integer'))

 

Image reference:

16.PNG

18.PNG17.PNG

Please take a try or provide more details.

Best Regards,

 

Community Support Team _ Barry
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

Okay,

 

Thank you for your help. I wasn't adding a second array of the same output of my variable.

 

That made the entire difference!

Hi @crf200,

 

Has your problem been solved?

 

Regards,

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

Yes, thank you for your help.

 

My issue was that I need the compose formula to include to arrays.

 

union(variable(),variable())

 

Even though I used the same array variable, it eliminated all duplicates.

Sk97
Frequent Visitor

Dear champions, I have a share point list which has items like below-

 

TitleAction OwnerPriority
TestValue-1JohnHigh
TestValue-2PeterHigh
TestValue-1JohnLow

 

Currently the flow i have created is sending 3 emails (2 to John and 1 is to Peter), Is it possible to group if John (Or any other owner)  ownes more than 1 item and send in only one email ??

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,219)