Optional condition that is checked before firing the Action

Dion
New Member

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.

0 22 547
22 REPLIES 22

Yes, thatโ€™s your exact problem. Bots trigger on data changes, virtual columns are not โ€œdataโ€.

Ahh. Thanks for pointing that out

Dion
New Member

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)

Aurelien
Google Developer Expert
Google Developer Expert

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:



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.

Aurelien
Google Developer Expert
Google Developer Expert

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:

@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
So I looked into the Test for the Bot:
3X_e_2_e2d02d5a3b6647efcc54291f0be82633a82f3f2e.png

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?

Aurelien
Google Developer Expert
Google Developer Expert

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.

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

Aurelien
Google Developer Expert
Google Developer Expert

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

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

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.

How did you do this? Give screenshots and details.

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

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.

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:
3X_1_c_1cf6999207373a613afcec35849bfb36faa78ba2.png

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.

Ummmโ€ฆdid you forget to read the rest of my reply?

Oh I did read it. Sorry I didnโ€™t mention that cause I kinda couldnโ€™t get it at first. So, I went to try it out. I think it worked I will do a few more testings and get back to you. Thanks a lot @Marc_Dillon

Oh, I havenโ€™t checked this out yet. How should I do it?

Aurelien
Google Developer Expert
Google Developer Expert

@Dion
I also see this, that may be what you are looking for, very simply ?
3X_d_f_dff05e1620e0d5b4a6bd1cb11166ec22e469b002.png

Dion
New Member

Problem solved. Thanks @Marc_Dillon for pointing out this

And thank you too @Aurelien I like your idea of this:

And Iโ€™m actually using it right now.

Top Labels in this Space