[_thisrow_before].[column_name]<>[_thisrow_after].[column_name] not working in triggering bot

Hello everyone, 

I have been trying to get this to work for the last 3 days and have gone through the community Q&A extensively but unable to find the bug in my app.

I am trying to trigger an email notification with a data change > Update only > Condition to check > [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit]. But now the app is triggering the notification irrespective of whatever changes I make. Also, the subject line of the email also contains the same formula [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit], which is working fine. But the only problem is that the event is getting triggered if I make any updates to any of the columns in my data and not just the [credit limit] column that I want it to be. 

Have tried to run combinations of [_thisrow_before].[credit limit]<>[credit limit] , [_thisrow_before].[credit limit]<>[_thisrow].[credit limit] as well but none of that works and the flow is triggered on every update to any column. 

Kindly assist! 

 

Utsav_Chhawchha_0-1681052587587.png

Utsav_Chhawchha_1-1681052722037.pngUtsav_Chhawchha_2-1681052748079.png

 

 

Solved Solved
0 13 609
2 ACCEPTED SOLUTIONS

Thank you. In the two examples you have shared screenshots of, is the understanding correct that the first screenshot shows where the credit limit has not changed and the second screenshot has example where it has changed?

If so, please use one of the following conditions for the bot event and test

If the [Credit Limit] is a numeric column such as number, price or decimal:

AND( [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit], [_thisrow_after].[credit limit]<>0)

If the [Credit Limit] is a non numeric column such as text:

AND( [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit], ISNOTBLANK([_thisrow_after].[credit limit]))

 

View solution in original post


@Utsav_Chhawchha wrote:

But problem would be that it will still trigger the event, when the [credit
limit] is not blank, say its Rs. 500 both before and after, and there is a
change in another column of the data, the email would get triggered right?


It should not. I request you to test and revert.

Edit: I have suggested this latest change because of a peculiar behavior with AppSheet expression evaluation, the description of which was present in earlier workflow documentation but has somewhere go lost in new automation documentation. @Steve has also guided on this quirk in his various posts.

Please take a look at the following image in the following post thread.

Suvrutt_Gurjar_0-1681467871424.png

Suvrutt_Gurjar_0-1681468109735.png

Solved: Workflow fires when Image column stays empty - Google Cloud Community

 

 

View solution in original post

13 REPLIES 13

What is the data type defined for the Credit Limit column?  It be most helpful so show us that definition.

The [_THISROW_AFTER] portion is optional.  Some have complained that they need to remove it to make the logic work.  I have NOT seen that problem in Bot conditions...yet.


@Utsav_Chhawchha wrote:

But now the app is triggering the notification irrespective of whatever changes I make


This would likely mean that you have re-configured the Condition in such a way that it always returns TRUE.  OR there is some other Bot (maybe a copy) being triggered doing this. 

 

 

Data type is defined as a number. I have tried doing it in text as well. Pls see the last row in the image of the schema attached.

Utsav_Chhawchha_0-1681107096741.png

I have 2 bots running on this data table. 

Utsav_Chhawchha_1-1681107214857.png

Both bots have different email templates and subject body so I cannot see another bot running on the same. 

Basically, as you mentioned, bot condition is always returning a positive, but unable to find the flaw. 

I just tried the log analyzer and found this. 

 

Utsav_Chhawchha_0-1681121765568.png

So the matchcondition is coming out to be true. However, we are not editing the field [credit limit] so don't understand why this is happening.

Note that row changes may not be just from Form view edits.  

If you have any actions attached to Form Save and those change [Credit Limit], then the Bot will fire.

If any of your Bots after Save use data change steps that change {Credit Limit] AND those Bots are set to trigger other Bots, then the Bot will fire.

Also consider that during the processing, that value could have changed and then changed back.

If you are using Google sheets, you can easily test this.  Have the sheet open.  Run your test and then quickly switch to the sheet and carefully watch the Credit Limit column of the row you just edited for any changes to the value in the sheet.

One last thing...are you using the correct trigger value?  The name of you Bot says "After Admin Approval".  It seems then you should be using the column that captures that Admin approval.

Hi 
Have been struggling with this still. I don't have any actions that are linked to this table that alters any data.

Utsav_Chhawchha_0-1681434467748.png

I have only 2 bots working on this table, both trigger an email notification on changing of certain fields. The 1st bot is using AND([_THISROW_BEFORE].[SOME FIELD]="XXXX",[_THISROW_AFTER].[SOME FIELD]="YYYY") as condition on update only. This is working perfectly

The other bot is the one we are discussing and is not working. 

I also made the change and stuck my eye on the google sheet [CREDIT LIMIT] column to look for any changes, but nothing is changing there.

There is no column called credit limit in any of my tables except one table that was reading the value from this table using ANY(SELECT), but that column also I changed now to another name.

 

One option will be to test in the template itself with both the before and after values of the column [Credit limit]. In your email template , please enter two values to capture 

Credit limit before : <<[_thisrow_before].[credit limit]>>

Credit limit after: <<[_thisrow_after].[credit limit]>>

The above fields in the template will capture if the [credit limit] column is really changing or not ( at least as seen by bot, if not in backend sheet or database)

For example, I set up a bot that triggers on change in phone number.Suvrutt_Gurjar_2-1681448747987.png

 

The template included both the before and after values [Phone] column as shown below:

Suvrutt_Gurjar_1-1681448692524.png

The below image is of email body received after the bot triggered, where it is clearly visible that the phone number has indeed changed ( only last digit of phone number was changed to trigger the bot)

Suvrutt_Gurjar_0-1681448540438.png

 

 

 

 

 

 

 

Yes have this setup already from the 1st day. 

 

This is how my email subject reads when this gets triggered when I am not changing [credit limit] but some other field in the data. It's blank in both before and after

Utsav_Chhawchha_1-1681452900189.png

This is how the email is recd when I actually change [credit limit]

 

Utsav_Chhawchha_0-1681453013449.png

Hence, column is correctly identified and before and after function is correctly working. But same is not working when I'm putting this as a condition for triggering the bot.

 

 

 

 

 

Thank you. In the two examples you have shared screenshots of, is the understanding correct that the first screenshot shows where the credit limit has not changed and the second screenshot has example where it has changed?

If so, please use one of the following conditions for the bot event and test

If the [Credit Limit] is a numeric column such as number, price or decimal:

AND( [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit], [_thisrow_after].[credit limit]<>0)

If the [Credit Limit] is a non numeric column such as text:

AND( [_thisrow_before].[credit limit]<>[_thisrow_after].[credit limit], ISNOTBLANK([_thisrow_after].[credit limit]))

 

But problem would be that it will still trigger the event, when the [credit
limit] is not blank, say its Rs. 500 both before and after, and there is a
change in another column of the data, the email would get triggered right?

The case problem is that there are 15 users, we are using core
subscription, and these users make several changes in columns other than
[credit limit] throughout the day. This column [credit limit] is not even
marked as show in the schema to anyone except me (admin). The bot should
only trigger an email to the finance dept once I change the [credit limit]
and not when other users make edits. Right now, there emails are getting
flooded even when this column [credit limit] is hidden from all 15 users
except me (having edit rights) and finance userID only having Read only
rights.


@Utsav_Chhawchha wrote:

But problem would be that it will still trigger the event, when the [credit
limit] is not blank, say its Rs. 500 both before and after, and there is a
change in another column of the data, the email would get triggered right?


It should not. I request you to test and revert.

Edit: I have suggested this latest change because of a peculiar behavior with AppSheet expression evaluation, the description of which was present in earlier workflow documentation but has somewhere go lost in new automation documentation. @Steve has also guided on this quirk in his various posts.

Please take a look at the following image in the following post thread.

Suvrutt_Gurjar_0-1681467871424.png

Suvrutt_Gurjar_0-1681468109735.png

Solved: Workflow fires when Image column stays empty - Google Cloud Community

 

 

This worked ! 

Thank you so much guys! Would never have been able to figure this one out. 

You are welcome @Utsav_Chhawchha . Thank you for the update. Good to know the issue is solved now.

@lizlynch :

You may wish to  document this peculiar condition requirement in automation event condition.

Basically if the automation condition is something like [_THISROW_BEFORE].[Column A]<> [_THISROW_AFTER].[Column A], then the condition evaluates to true even if the [Column A] has not changed but it has remained blank in before and after values when a record is updated.

So, the suggested addition to the expression to overcome this issue is 

Edit:  the below referred expression as suggested by @Steve in the post thread referred below

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

or the following that existed in earlier Workflow documentation

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

This quirk was documented in earlier workflow (predecessors of current automation) document. At least I could not find it in current documentation. Will request you to include it in automation events documentation conditions section suitably. An old post that referred this documentation and excerpts from the documentation is here:

Solved: Workflow fires when Image column stays empty - Google Cloud Community

It sounds like there might be an issue with the condition you have set for your email notification. Here are a few things you can try:

  1. Check that you have correctly set the condition to check if the credit limit has changed. Double-check that you have used the correct column name and that the condition is set to "Update only".

  2. Check that your table is correctly set up to track changes. To do this, go to the table editor, select the "Behavior" tab, and make sure that the "Track updates" option is turned on.

  3. Check that the workflow rule associated with the email notification is set up correctly. Make sure that the "Only when this condition is true" option is selected and that the condition is set to check for changes to the credit limit column only.

  4. Try creating a new email notification workflow rule from scratch and see if that works. Sometimes, starting fresh can help identify any errors that may have been missed previously.

Top Labels in this Space