Is [_THISROW_AFTER] actually completely unnecessary?

So a fairly typical Bot Event condition might be to detect a change in a column’s value, like:

[_THISROW_BEFORE].[column] <> [_THISROW_AFTER].[column]

In my experience, this is 100% equivalent, in all cases, to simply:

[_THISROW_BEFORE].[column] <> [column]

There is never any “after” value, there’s always just the current value.

Has anyone else noticed this?

Or does anyone have an example of a case where using [_THISROW_AFTER] is actually necessary or beneficial in any way?

2 Likes

Haven’t used it, so I’m just hypothesizing :slightly_smiling_face:

Theoritically, [_ThisRow_After] stores the value that I have written to the column, while at a given time, the current column value could or not correspond to my change, depending in whether there have been other changes to the column. Hence, there’s a possibility that [column] equals [_ThisRow_BEFORE].

There is a subtle difference between [_ThisRow_After] and [column].
It is described in topic “After value” in this article https://help.appsheet.com/en/articles/5296566-accessing-column-values-before-and-after-an-update.

The subtle bit is at the end. It says:

In summary:

  1. You can compare the Before and After values to see the changes made by the update that triggered the bot.

  2. You can compare the Before and current [FieldName] values to see all changes including both the update that triggered the bot and all subsequent Data Change Actions.

2 Likes

Interesting. Thanks @Phil ! To quote myself: “Always read the help articles, even when you think you know what you’re doing”.

It’s still a bit unclear how or when I would use this difference though. Here’s a situation where I think it may apply:

  1. User changes [col] to “A”
  2. Bot triggers on this change.
  3. Bot Process Step 1 executes a data-change Action that changes [col] to “B”
  4. Now we’re in Bot Process Step 2. Is it correct that within this second step [_THISROW_AFTER].[col] would return “A”, but [col] would return “B” ?

Sorry KJ, I’m not really sure what you’re getting at.

Thanks Marc, it is OK. First of all we now have Phil’s answer, and I was just guessing making an analogy from elsewhere. FWIW, I was saying that [column] doesn’t have a change implication, while [_ThisRow_AFTER], records the change in its own context. This change at a the moment of the query may or may not correspond to [column].