web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Contains Condition bet...
Power Automate
Unanswered

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
    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,436 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard