Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Distinct Values From SP List

Is it possible to generate an array with the Compose function based on a Sharepoint list, but only distinct values? I want the following code to run:



for each (item in MyArray){
    if (MyArray.contains(item)){ // note1
        do nothing;

I am getting hung up recreating the line note1 is on. I can't seem to use the contains condition on an array I am working on


I am using the compose feature to make the array which I think has to do with it...thanks for any help

Level 8

Re: Distinct Values From SP List


You can try with WDL union function (

According to the definition of this funtion, it should work even with one input parameter, so in theory you do not even need the foreach. 


Also if you have the dictionary with all possible values in advance, you can try with WDL intersection function.


I am afraid I have never tried iany of these expressions before


Please note some days ago Flow team has completed the rollout of a new feature, so that you can use expressions in action blocks, Compose workaround is not mandatory anymore


Level: Powered On

Re: Distinct Values From SP List

Ended up solving this by just dumping the data to a SQL table

Community Support Team
Community Support Team

Re: Distinct Values From SP List

Hi @ChrisCC,


To filter array, Flow has an Action call Filter Array, which allows to apply fitler under each item within the array, take a look at the blog below:

Build more advanced flows than ever

Checking the Filter Arrarys part.

Post back if you have any further questions.




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.
Level: Powered On

Re: Distinct Values From SP List

I can see you found a workaround for this but if the need comes up again I solved it like this.

Helpful resources


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users Online
Currently online: 168 members 4,526 guests
Please welcome our newest community members: