cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
craig-martin
Microsoft
Microsoft

Select Unique Items

Is there a way to select unique items from an array?

6 REPLIES 6
v-micsh-msft
Community Support
Community Support

Hi @craig-martin,

 

Could you please explain a bit for the unique items here? If you mean an item filtered with some special condition, then I think the filter Array Action would work with your scenario.

Build more advanced flows than ever

 

Personally I think the selection from Array is not available.

The data being queried are not pre-loaded when configure the flow, so there is no data could be chosen from the array, 

Further, the data which would be loaded in array might change, the pre-configured item may not work.

what we could do when configure the Flow is working with conditions, or the available OData Query option, such as fiter query, orderby, or select query (in SQLServer).

If I misunderstand something, please let me know.

Regards,

Michael

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

if an input is an array with items a,a,b,c,c then I'm wondering if an Action in Flow can output just the unique items, so a,b,c.

Hey @craig-martin, did you ever figure out a way to filter just unique items? 

Unfortunately I did not.

martinfy
Regular Visitor

Hi,

Use the built-in union or intersection functions. They are both fast and require few steps:

intersection(variables(‘largeArray’),variables(‘largeArray’))

union(variables(‘largeArray’),variables(‘largeArray’))

See here for more details: https://medium.com/@martinfy/the-fastest-way-to-find-unique-items-with-flow-f9618ef7224

ericonline
Community Champion
Community Champion

Where oh where is Except!!

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (58,750)