Call a Process with [_THISROW_BEFORE] and [_THISROW_AFTER]

We can use Call a Process to update a table.
Imagine a Shop. You add a product to the Cart and set the amount.
By adding this row, a Bot is fired. Via Call a Process you change the amount in the Stock Table.
So when you add an item to the Card with amount = 2, the amount in Stock Table will be subtracted by 2.
Thatโ€™s perfect.
But what if you donโ€™t add a new item, but change the amount of an existing item? Or even delete the item?

In Jan 2023 I was able to use  [_THISROW_AFTER].[Amount]-[_THISROW_BEFORE].[Amount].
But this is no more working now. The Process does not receive any value with that expression.
When I use just the column [Amount] it is working.
So it seems that [_THISROW_BEFORE] / [_THISROW_AFTER] is currently no more working in Call a Process. (There is no error in AppSheet.)

Can anyone confirm that [_THISROW_BEFORE] / [_THISROW_AFTER] is no more working in Bots, or in Call a Process?

@dbaum 

Solved Solved
1 12 1,387
1 ACCEPTED SOLUTION

@Fabian_Weller - OK, the change should be released. Can you let us know if your issue is resolved? Thank you!

View solution in original post

12 REPLIES 12

@lizlynch could ask to the team

Yes, will check with AppSheet team!

Can you clarify where exactly are you using THISROW_BEFORE/AFTER?

Yes for sure @Marc_Dillon.

The Bot fires when there is a change in the Table "Material" with this condition:
AND(
ISNOTBLANK([Ersatzteil]),
[_THISROW_BEFORE].[Menge]<>[_THISROW_AFTER].[Menge]
)

Fabian_Weller_0-1690353722034.png

Then the Call a Process changes the value in column "Bestand Ist" in the Table "Ersatzteile_Auswahl".
Fabian_Weller_1-1690353870726.png

The expressions are:
Key: [Ersatzteil].[Ersatzteil] (A dereference from the table "Material" to the table "Ersatzteile")
Bestand Ist: [Ersatzteil].[Ersatzteil].[Bestand Ist] - [Menge] (A dereference from the table "Material" to the table "Ersatzteile" to the table "Ersatzteile_Auswahl)

This subtracts the column [Bestand Ist] by the value in column [Menge].
But this is working only if you add a new row to table "Material". It is not working correct if you change [Menge] afterwards or if you delete the row.

That's why I was using this expression:
[Ersatzteil].[Ersatzteil].[Bestand Ist] - ([_THISROW_AFTER].[Menge]-[_THISROW_BEFORE].[Menge])

This is working for add, edit and delete. It was working in Jan 2023 and is no more working since... I don't know exactly... maybe some weeks?

@lizlynch Thank you for checking with the team. This is the App Name: appName=Wartungsliste_Test-38452-651676

@Fabian_Weller - A fix for this issue has been released today. Let us know if you are still experiencing problems

Thank you @lizlynch for the fast fix! But it is still not working.

This is the behavior when using the expression 
[Ersatzteil].[Ersatzteil].[Bestand Ist] - [Menge]
This behavior is expected.
[Bestand Ist] has the value 0.

 

Add a row with [Menge] = 1  [Bestand Ist] = -1 (subtracted by 1)
Edit the row and change [Menge] to 2 [Bestand Ist] = -3 (subtracted by 2)
Delete the row where [Menge] = 2 [Bestand Ist] = -5 (subtracted by 2)

But this is useful only for Add.

The goal is that in an Edit it should not subtract by the actual value (2) but by the difference of the before and after value (before = 1 ; after = 2 ; difference = 1).

Same with Delete. It should not subtract the value, but add it.

This was working with the expression
[Ersatzteil].[Ersatzteil].[Bestand Ist] -
([_THISROW_AFTER].[Menge] - [_THISROW_BEFORE].[Menge])
Now the behavior is like that.
This behavior is not expected.
[Bestand Ist] has the value 0.

 

Add a row with [Menge] = 1  Nothing happens
Edit the row and change [Menge] to 2 Nothing happens
Delete the row where [Menge] = 2 [Bestand Ist] = -2 (subtracted by 2)

The Add should subtract 1.

The Edit should subtract 1 again.

The Delete should not subtract 2, but add 2. Because in the expression it should be:
[Ersatzteil].[Ersatzteil].[Bestand Ist] -
([_THISROW_AFTER].[Menge] - [_THISROW_BEFORE].[Menge])

[Ersatzteil].[Ersatzteil].[0] -
([0] - [2])

โ†’ 0 - (-2) = 2

 

It's also hard to debug, because the Output Data in the Bot's Monitor is empty.

Fabian_Weller_0-1690440593428.png

 

@Fabian_Weller - Thank you for this additional detail... and your patience! Passing this on to the team. 
Liz

@Fabian_Weller 
Sincerest apologies. The release that contained this fix was rolled back temporarily. I will update the release notes and report back when it's been released again.

Thank you for your fast reply @lizlynch. Really appreciated ๐Ÿ™‚

@Fabian_Weller - OK, the change should be released. Can you let us know if your issue is resolved? Thank you!

@lizlynch Thank you. WOW! Everything is working again as expected. Add, Edit and Delete. It's perfect. Thank you very much ๐Ÿ˜ƒ

GREAT! Will pass on the thanks! ๐Ÿ™‚

Top Labels in this Space