IF tag does not match even though it says it matches in test

image

image1382×684 60.6 KB

why is this failing?

when I tested in the expressions it literally says true

image

image1372×390 35.1 KB

pleased no point scorers and AI posters.

I already asked AI

1 Like

@bally Even though the expression shows true, the IF node might be receiving it as a string "true" instead of a boolean true.

Try this fix:

{{ $json.tags.includes('Influencer') }}

Please make sure you are not enclosing that in quotes in the condition part of the IF node.

Let me know if this worked.

1 Like

Hi @bally I see the issue, i guess i have suggested a solution for this in the past, for now again you currently are using an IF block to match a list of items and a single item, so even though the list of item contains that matching ID it still return false as other IDs do not match that id, what i would recommend that instead of using contains you should be using the .includes function and inside that pass down your second object to match, it would return true if it does and false if it does not. something like

{{ $json.currentIDs.include( {{ $node[“Single Email”].json.id }} ) and this is like a overview you might have to change some types if needed like .toString but this is the thing you should be using when matching arrays to a single object. Something like that.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.