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' function al...
Power Automate
Answered

'Contains' function always resulting in false

(0) ShareShare
ReportReport
Posted on by 503

Hi there, 

 

I am facing a strange issue where a contains function is always resulting in false. 

 

I have 3 compose actions for simplicity. 

 

Compose 1 has the following inputs - 

items('Apply_to_each')?['emailaddress1']
 
Compose 2 has the following inputs (this compose action contains outputs of an Array variable action higher up in flow) - 
variables(userEmailArray) 
 
Compose 3 has the following inputs - 
contains(outputs('Compose_2'), outputs('Compose_1'))
 
Strangely this always results in 'false' even though I know it should be true. I have double checked the email coming out of Compose 1 is in the Compose 2 results. I have also tried using trim and toLower to get rid of spacing or uppercase values but no luck. 
 
Really stuck here so any help is appreciated. 
 
Thank you. 
 
 
Categories:
I have the same question (0)
  • Srini007 Profile Picture
    3,327 Super User 2025 Season 2 on at

    Hi @Usernametwice23 

     

    This could be because you are checking a EmailID against to EmailIDarray

    Check below post for your reference

     

    https://powerusers.microsoft.com/t5/Building-Flows/Check-if-an-item-exists-in-array/td-p/249531

     

    If you find this reply helpful, please consider giving it a LIKE AND

    If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION

     

    Thanks,

    Srini

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Usernametwice23,

     

    It could work. Would be good to see what are you using in your array variable as a value?

     

    Is it that value structured like below?

    ["jane@contoso.onmicrosoft.com","john@contoso.onmicrosoft.com"]

     

    Can you share a screenshot of the compose1, compose2 and compose 3 actions of the flow run, which didn't work?

     

    checkiteminarray.png

     

  • Usernametwice Profile Picture
    503 on at

    Hi @Expiscornovus 

    Thank you for your response. In regards to what I am using in my array variable as a value - I am using the outputs of a 'select' action which is returning a long list of emails from a HTTP request to Azure. 

    The value structure coming out of the array is like below: 

    [ 
    {
     "email": "sample1@sampleemail.com"
     },
     {
     "email": "sample2@sampleemail.com"
     }
    ]

      

    Sure, I can share the screenshots - 

    Screenshot 2023-06-03 130409.png

    Screenshot 2023-06-03 130439.png

    Screenshot 2023-06-03 130459.png

     

    As mentioned I did a search on the Compose 2 results and the email is definitely there. 

     

    Thank you very much for your help!!

     

  • Verified answer
    Usernametwice Profile Picture
    503 on at

    Hi I got this figured out. 

     

    Screenshot 2023-06-05 123934.png

    Ended up using a filter array and compared the email coming from the List above. 

  • Expiscornovus Profile Picture
    33,195 Most Valuable Professional on at

    Hi @Usernametwice23,


    Apologies for the delayed reply.

     

    You can use that same approach in the Select action as well. Just switch the map field of the Select action to text mode (with the button on the right side). In that Map field you can use the 

     

    item()['email']

     

     

    This way you don't have to add the new Compose and Filter Array actions and you can simply reuse your Select action.

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

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard