Subsequent "IF" do not work

Hello members of this awesome community,

I just realized that IF node stops working correctly if there is a preceding IF node immediately before it.
Is that the expected behavior?

The first IF checks if Field#1 in Airtable is not empty (result is correct). The second IF immediately after it is checking that a different field#2 is not empty. The result in this node turns out to be incorrect.

And yes, I know that I can have multiple conditions in one node, but am just curious to see what’s going on here.

TLDR: when working with Airtable records, the first IF conditions returns correct results, while 2nd/3rd ones are very “random”. Checking if the record value IS EMPTY doesn’t seem to work correctly

UPD: If the subsequent IF condition depend on the data returned in the previous step, it works correctly. That’s great to know, but still weird?

The check here is to see if “Curr Manager” is Empty. As you can see, record 1 and 3 satisfies this condition, but record 2 and 4 do not and should go to False.

However, if I use this condition in the FIRST IF NODE, it works correctly!

Yes, that is probably expected behaviour. The reason will be that the number of items changes. If before the IF you have 10 items, then after it you have 5, will the data probably not match up anymore.

Example: You have two items, both have the property name set:

  1. Name: Frank (index: 0)
  2. Name: Jim (index: 1)

Then you have an IF-Node which filters the first item (“Frank”) out, so that only the second one (“Jim”) is left. You then have the second IF-Node which compares $json["name"] equals $node["node-before-if"].json["name"]. That would resolve to false.

It will go over all items (in this case is there only one), one after another. So the only item on the node (the one which has name set to “Jim”) has index 0 at the second IF-Node (so $json["name"] returns Jim). The expression $node["node-before-if"].json["name"] would return Frank as that is what the item with index 0 has on that node.