Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Connectors
Answered

Contains Condition between array variable and select action(filter array)

(0) ShareShare
ReportReport
Posted on by 136

How to use condition control(contains) between array variable and select action of filter array? Is that possible?

 

I want to filter the array variable if array variable contains the value which is there in the select array

 

Regards,

DML

  • Chriddle Profile Picture
    7,793 Super User 2025 Season 1 on at
    Re: Contains Condition between array variable and select action(filter array)

    Not sure, if this is what the op wanted, but I would solve this like this (without loop and variable):

     

    Use a Select action with From: Array1

    1. to store the original item
    2. and calculate if Array2 contains the part of the Array1 item that is comparable
    3. then Filter this calculation
    4. and restore the oringinal structure of the filtered array

     

     

     

    Chriddle_1-1694528778278.png

     

     

    Select expressions:

    Item:

    item()

    Contains:

    contains(
    	outputs('Array2'),
    	json(
    		concat(
    			'{"Col1": "',
    			item()['Col1'],
    			'"}'
    		)
    	)
    )

    If the json(concat('{"Col1": "',item()['Col1'],'"})) part becomes too large in reality, add it to Array1 in advance with a Select action

     

    Select 2 expression:

    item()['Item']

     

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: Contains Condition between array variable and select action(filter array)

    Hi @DML1 ,

     

    Power automate cannot compare 2 arrays directly. I did a sampe for you.

    vxiaochenmsft_0-1654674505177.png

    vxiaochenmsft_4-1654675186023.png

    vxiaochenmsft_5-1654675206372.png

    vxiaochenmsft_6-1654675213949.png

    vxiaochenmsft_7-1654675222673.png

    item()?['Col1']
    items('Apply_to_each')?['Col1']
    length(body('Filter_array'))

     

    Best Regards,
    Wearsky

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492

Featured topics