Optional condition that is checked before firing the Action

I was trying to use the following condition to fire an action in the automation (to send an email):

AND([_THISROW_BEFORE].[Percentage Completed] < 1,
[_THISROW_AFTER].[Percentage Completed] = 1)

But it doesn’t work. [Percent Completed] is a virtual column. Does it have anything to do with the problem I’m facing by any chance?

Another info here, the following condition, which is quite similar to the first one, works just fine in another bot:

AND([_THISROW_BEFORE].[Status] = “Open”,
[_THISROW_AFTER].[Status] = “In Progress”)

[Status] is not a virtual column.
Feel free to speak if you need further info about the problem I’m facing. Thanks.

Yes, that’s your exact problem. Bots trigger on data changes, virtual columns are not “data”.

4 Likes

Ahh. Thanks for pointing that out :grinning:

1 Like

I’m back. I managed to pass the value from the virtual column [Percentage] into the non-virtual column [Percent Completed]. And I intended to use this non-virtual column as a condition to trigger a Bot to send an email. But it doesn’t work, and I don’t understand why. Can anyone see this question help?
This is the condition with non-virtual column:
AND([_THISROW_BEFORE].[Percent Completed] < 1,
[_THISROW_AFTER].[Percent Completed] = 1)

Hi @Dion

Virtual columns are calculated “on the fly”, real columns are calculated “on editing”.
I suspect this is the new issue you are facing, if percentage is calculated from another table.

My suggestion:
You may want to set an action that will update this value at any necessary time.

Typically, this could be a combination of:

  • action1 that will be performed on a “Behavior” section of a form
  • action1 “Execute an action on a set of rows”, that will trigger the action2 on another table
  • action2 “set the value of some columns in this row” that will update the value

For example:



3 Likes

This is indeed the way that I used to update the value in the real column at any necessary time. But I am still unable to use the value of real column to trigger the bot.

OK.
What if you use the bot to set a value on a column “check” ?
So that, the previous condition

AND(
  [_THISROW_BEFORE].[Percent Completed] < 1,
  [_THISROW_AFTER].[Percent Completed] = 1
)

will become:

AND(
  NOT([_THISROW].[check_YesNo]) ,
  [_THISROW].[Percent Completed] = 1
)

(assuming initial value for [Check_YesNo] is set to false, of course)
And, the next step of your bot will be to switch that column [Check_YesNo] to true.

What made me think to this suggestion:

and I don’t see any mention of the use of [_THISROW_BEFORE] and[THISROW_AFTER] in this post, even if, in the case of an update, it should be possible to use it:

2 Likes

@Dion
I also see this, that may be what you are looking for, very simply ?
image

@Aurelien

OK.
What if you use the bot to set a value on a column “check” ?
So that, the previous condition

AND(
  [_THISROW_BEFORE].[Percent Completed] < 1,
  [_THISROW_AFTER].[Percent Completed] = 1
)

will become:

AND(
  NOT([_THISROW].[check_YesNo]) ,
  [_THISROW].[Percent Completed] = 1
)

I just tried your suggestion. The Bot still isn’t triggered :thinking:
So I looked into the Test for the Bot:
image

The Event Condition for the specific row that I’ve been testing on indicated “True”. The other rows were “False”. Does it mean the Bot was supposed to be triggered for this row?

Yes.
Can you have a look on the “Monitor” button/app ?

@Dion

Is this a “schedule” bot ?
If so, that won’t do anything if the app is not deployed.

I’ve checked that as well. It showed that the Bot wasn’t triggered (number of times didn’t increase since last time).
The default “False” value wasn’t set to “True” too.

It is not a schedule bot. It is set to trigger based on Data Changes

At this stage, I would suggest to contact Support, I don’t get why this is not firing the Process.

But I’m probably missing something, let’s wait for @Marc_Dillon or someone else to wake up and have a look :slight_smile:

1 Like

Alright, thank you so much for your help, though. I really appreciate it!

How did you do this? Give screenshots and details.

Have you checked the Audit Log? It provides much better information than the Automation Monitor.

2 Likes

How did you do this? Give screenshots and details.

First, I began with creating an action, “Update Percentage” which will set a real column’s value to the virtual column’s value (as shown right below this sentence).

After that, I created a Bot with the “Data Change” Event type “Adds only” to the “Completed” table. This table has many-to-many relationship and shows the record of the training each user has done (refer to the picture below).

In this Bot, I created a “Run a data action” process with “Run action on rows”.


In Referenced Action, I used back the “Update Percentage” action that I’d created at the beginning.

This is how I did it.

Oh, I haven’t checked this out yet. How should I do it?

Just to clarify, you’ve got:

  1. Bot on Adds to the Completed Table, which:
  2. Runs an data change Action on a record in the Employees Table.
  3. A 2nd Bot meant to trigger on changes in Employees Table.

And it is #3 that is not triggering?

That would be because by default, data changes from Bots, do not trigger other Bots. But you’re in luck, since they’ve recently given us the option to allow this, and it’s as easy as flipping this switch on your first Bot:


From here:
image

2 Likes

The Bot that I mentioned in my previous comment works well. It is used to pass virtual column value to a real column. And there’s actually a 2nd Bot that will be triggered by the optional condition based on the value of that real column, in order to send an email. But the 2nd Bot won’t work, I don’t know why.