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 / Contains Condition bet...
Power Automate
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

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    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
  • Chriddle Profile Picture
    8,697 Super User 2026 Season 1 on at

    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']

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 412

#2
Vish WR Profile Picture

Vish WR 305

#3
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

Last 30 days Overall leaderboard