$$rowcount$$ vs $$rowindex$$

Hi @HansS , yes there are indeed inconsistencies across nodes with the value of Row Index. Some nodes think it starts at 1 and others think it starts at 0. I think it is recognised that it occurs but for backward compatibility reasons cannot be fixed.

The worst inconsistency for me is in Row Filter, where the node is actually inconsistent with itself :rofl:

:thinking: Ordinarily whatever you see in the config of a node is what you can pass in with a flow variable. But Row Filter doesn’t behave like other nodes in this regard.

Take the following table:
image

If I manually enter the row range 3 to 7 in Row Filter

it returns rows 3 to 7 as expected, using (human) counting starting at 1:

But if I create flow variables with the values 3 and 7, and pass those in:

It treats it as if I’d manually entered 4 to 8, because it “decides” that I must now be using zero-based counting. That is most definitely inconsistent with flow-variable config behaviour elsewhere.

image

I thought I saw a new node (in 5.x) recently that did the same, but the only new nodes that spring to mind that have Row Number entered in this form are
Table Cropper
Cell Splitter
and both of these (certainly in 5.2) treat the flow variable value as if it were the manually entered value (ie what you see on the dialog is what you enter in a flow variable) and so do not behave like the old Row Filter does.

You may be interested in the following posts:

2 Likes