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 / Unable to get "Does No...
Power Automate
Answered

Unable to get "Does Not Contain" in "Current Item" to Evaluate Properly

(0) ShareShare
ReportReport
Posted on by 25

I'm a bit stuck on a pretty complicated Flow I've been building.

 

The part I can't think of how to troubleshoot further is a conditional For Each that doesn't seem to be evaluating properly:

 

TF_L_0-1708355834347.png

 

To add some context, the "Apply to Each" runs on a list of numbers, 1 ~ 181, one number at a time. If the Condition Evaluates to True, it will then append the number to a 2nd Variable.

 

Basically, the logic is "If List A [Current Item] is not found in List B, append [Current Item] to List C".

 

However, the Conditional checks are always incorrect. The List B variables are Array variables which likewise hold a list of numbers. In this case, List B contains "1", "12", among others. However, the Condition always evaluates to True, regardless of what is in List B. Automate gives no feedback on what the evaluation is actually doing, only that it results in True, which doesn't help.

 

I have List B as the entire list rather than individual items in the list, because comparing each item would improperly compare the sequences (List B might have 1,8,12, and it would compare that to 1,2,3).

 

Is there a better way to compare lists? This method seems inadequate and also faulty.

Categories:
I have the same question (0)
  • Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @TF_L 

     

    If left side of condition contains the number in string form, then you need to type cast the right-side operand to string to make them compatible for comparison. Here is an example:

    ManishSolanki_0-1708357140680.png

    string(item())

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • TF_L Profile Picture
    25 on at

    Hello @ManishSolanki ,

     

    The List B variable does contain the list in number form:

    TF_L_0-1708358211842.png

     

    I was ready to dismiss your comment, but it made me think about List A.

    List A gets the numbered list from a SP Column which I just remembered comes in as a string.

    TF_L_2-1708358401695.png

     

    Unfortunately, the SP Column that has the numbers is the "Title" column so it is stuck as a string. Bad planning on my part.

     

    I used an int() expression when appending them to List A to begin with, and now List A and List B are both numbers:

    TF_L_3-1708358788019.png

     

    Unfortunately, however, the problem persists. The condition always evaluates to "True", despite List B having values.

  • Verified answer
    Manish Solanki Profile Picture
    15,169 Moderator on at

    Hi @TF_L 

     

    Pls try reverse. Instead, trying covert to string & perform comparison. I had also faced the same issue with array of int but worked when I changed to string array.

     

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

  • TF_L Profile Picture
    25 on at

    Wonderful, that worked. Thank you for your help!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 785

#2
Valantis Profile Picture

Valantis 669

#3
Haque Profile Picture

Haque 563

Last 30 days Overall leaderboard