Workflow fires when Image column stays empty

I have a Workflow that fires a Data Change Action. Updates only.
My workflow condition is:
[_THISROW_BEFORE].[Image]<>[_THISROW_AFTER].[Image]
When the image column is empty and I edit another column, the workflow will fire, even though there was no change in the image column.
If there is an image and I edit another column, the workflow will not fire.

The only workaround I found is to change the condition:

AND(
  ISNOTBLANK([Image]),
  [_THISROW_BEFORE].[Image]<>[_THISROW_AFTER].[Image]
)
Solved Solved
2 8 365
1 ACCEPTED SOLUTION

Hi @Fabian ,

Thank you for sharing the experience. The solution you applied of adding ISNOTBLANK([Image]) in the workflow condition is indeed correct and recommended by AppSheet as well. The reason why it is needed is explained in the article below.

Please look for the description under the topic " Sending Email When a Row is Added, Updated, or Deleted"

"When comparing before and after values, be aware of the following issue. If both the before and after values are empty, the following expression always return โ€˜trueโ€™.

View solution in original post

8 REPLIES 8

Hi @Fabian ,

Thank you for sharing the experience. The solution you applied of adding ISNOTBLANK([Image]) in the workflow condition is indeed correct and recommended by AppSheet as well. The reason why it is needed is explained in the article below.

Please look for the description under the topic " Sending Email When a Row is Added, Updated, or Deleted"

"When comparing before and after values, be aware of the following issue. If both the before and after values are empty, the following expression always return โ€˜trueโ€™.

Steve
Platinum 4
Platinum 4

Try just this:

(("x" & [_THISROW_BEFORE].[Image]) <> ("x" & [_THISROW_AFTER].[Image]))

or this:

NOT(IN([_THISROW_BEFORE].[Image], LIST([_THISROW_AFTER].[Image])))

Hi @Steve ,

Innovative expressions as usual.

Since you have specifically recommended different expressions, could you please update if adding ISNOTBLANK([Column Name]) has any quirk or some such issue that we may be unaware of?

Looking at this expression:

AND(
  ISNOTBLANK([Image]),
  [_THISROW_BEFORE].[Image]<>[_THISROW_AFTER].[Image]
)

My first thought is: to which does the unqualified [Image] refer? Before? Or after? I believe it refers to after. If so, then this:

[_THISROW_BEFORE].[Image]<>[_THISROW_AFTER].[Image]

is equivalent to this:

[_THISROW_BEFORE].[Image]<>[Image]

Given the quirk with the = and <> operators, this expression is TRUE if [_THISROW_BEFORE].[Image] is blank, regardless what the value of [_THISROW_AFTER].[Image] (or [Image]) is. That result is useless in this context. Wrapping this inequality expression in AND() and adding the ISNOTBLANK() test of [Image] doesnโ€™t improve the result. Testing [_THISROW_BEFORE].[Image] instead helps, but doesnโ€™t catch the case where before is blank but after isnโ€™t, so weโ€™d have to test for that, too:

IF(
  ISBLANK([_THISROW_BEFORE].[Image]),
  ISNOTBLANK([_THISROW_AFTER].[Image]),
  ([_THISROW_BEFORE].[Image] <> [_THISROW_AFTER].[Image])
)

Rather than that long convoluted expression, either of the two I posted are as effective, shorter, and easier to understand.

Thank you very much @Steve for the detailed explanation. Got it now.

I may request you to change the Workflow help article accordingly. I have been using the expression in the following format in workflow conditions, based on the Workflow article. So far it seems to have worked but as you mentioned, it could have potential issues.

AND( [_THISROW_BEFORE].[Status] <> [_THISROW_AFTER].[Status], ISNOTBLANK([Status]) )

Thisโ€™ll be an ongoing process. The doc is long and needs a lot of work. But itโ€™s on my to-do list.

Thank you @Steve

Thank you so much @Suvrutt_Gurjar and @Steve I wasnโ€™t aware of that.
I changed my post from Bug to Question

Top Labels in this Space