Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

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

(0) ShareShare
ReportReport
Posted on by 23

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.

  • TF_L Profile Picture
    23 on at
    Re: Unable to get "Does Not Contain" in "Current Item" to Evaluate Properly

    Wonderful, that worked. Thank you for your help!

  • Verified answer
    ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Unable to get "Does Not Contain" in "Current Item" to Evaluate Properly

    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
    23 on at
    Re: Unable to get "Does Not Contain" in "Current Item" to Evaluate Properly

    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.

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on at
    Re: Unable to get "Does Not Contain" in "Current Item" to Evaluate Properly

    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.

     

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 >