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 / Remove repeated values...
Power Automate
Answered

Remove repeated values in one Array

(0) ShareShare
ReportReport
Posted on by 26

Dear The Community! My question sounds silly a bit, but tried a lot before asking You!)

My Array is in picture below and I need as the Output just "1.7" , as "1.6" is repeating... 

Den74_0-1602681296163.png

seems i need like opposite to "Intersection" function...

 

 

Categories:
I have the same question (0)
  • yashkamdar Profile Picture
    1,044 on at

    Hello Team,

     

    This is extremely easy to implement, let me guide you.

     

    First see my outputs and final results-

     

    I had an array that had values 1,2,2,3,2 and needed to remove duplicates.


    I used the Union() expression and got the final result 1,2,3.

     

    yashkamdar_2-1602700825506.png

     

     

    How to do this, first load your array outputs in COMPOSE. My Array outputs are currently residing in array variable called ARRAY

     

    yashkamdar_3-1602700844420.png

     

     

     

     

    Then Create another COMPOSE and use the following expression -

     

     

    union(outputs('Compose'),variables('Array')) 

     

     

    Here COMPOSE is the action where the Array was loaded and Array is the name of the Array variable. Please refer the 1st compose action we create you will understand it.

     

    This is all you need to do.

     

    Once this is done, create another COMPOSE and load the outputs of Compose created earlier (the one where we put the expression) to get unique values returned.

     

     

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

  • Den74 Profile Picture
    26 on at

    Hi @yashkamdar , thanks, but that is not exasctly what i'm looking for.

    I need TOTALY remove repeated values.

    For example: from [1,6,6,5,5,2] i need to receive just [1,2]

     

    How difficult that is?

     

  • Verified answer
    VictorIvanidze Profile Picture
    13,079 on at

    Hi @Den74 ,

     

    sort an array and then in do-while cycle compare each element with the next one. If they are equal compare with next element. As soon as element a[n+x] is different than a[n],

    remove all elements from a[n] to  a[n+x-1].

  • Den74 Profile Picture
    26 on at

    Hi @VictorIvanidze , Thank you for the given tip!)

    But your suggestion to sort the array was smashed by the remark - "Have you ever tried to sort an array or collection in Microsoft Flow? Did you ever look for the Sort function when you build your expressions? You can stop searching! It doesn’t exist...." from this article here https://sharepains.com/2019/07/13/sort-an-array-or-collection-in-microsoft-flow/ 

    Its so complicated..., so if once i will do sorting i will then spend days with the rest - do-while cycle to compare, then removing...

     

    Does anybody knows an EASIER way to change array from [1,6,6,5,5,2] into [1,2] by removing repeated values? 

     

     

  • VictorIvanidze Profile Picture
    13,079 on at

    Well, @Den74, I do not think there is an easier way to do what you want.

    If the task is too complicate for you, try to hire an expert. 

  • VictorIvanidze Profile Picture
    13,079 on at

    And, by the way, sorting an array has well described here (thanks Manuel  Gomes!)

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard