Stop 🛑 Using automation bot to create ACTIONS inside a BOT. I had an action that updates count + 1 parent row on changes made in child row.
Instead do this
This was the issue I was facing after form save. The child row takes a random ID that does not even exist anywhere in database.
I spent two days figuring out a bug. Every other day this is my job now. Trying to fix broken things thinking it was my mistakes.
Not sure what caused this bug, but changing the bot action manually created from behavior fixed it. It seems that this could be the cause since I've noticed that the parent row doesn't update properly or shows an error if it's a REF row.
I contacted support and they weren't able to identify the root cause. The current situation is we must find issues, we only find root causes, we do not use that, we only find workarounds.
@Rifad I created a sample app that has a bot setup similar to this app: https://www.appsheet.com/templates/This-app-shows-how-to-use-reference-actions?appGuidString=e76d2e7... basically when something changed in the parent row, then +1 to all the referenced rows for the child table. Everything was setup using the new UI: create the action inside of a bot. There are times that the editor might not have the latest data changes, but if i refresh, then it has the latest data. I cannot repro the issue you were referencing to.
The link is not working.
@Lusha_Wang1 wrote:
There are times that the editor might not have the latest data changes
I am not sure why it is like this. When I trigger an action why does it not have latest data ? It works perfectly in editor.
@Lusha_Wang1 wrote:
but if i refresh, then it has the latest data.
Still not clear what you meant sorry. When a looping action is triggered all the new rows are created and parent rows are updated. What latest data are you mentioning.
@Lusha_Wang1 wrote:
Link doesn’t work
@Lusha_Wang1 wrote:
I cannot repro the issue you were referencing to.
I will share a simple example today.
I will explain with more details, e.g. when I update some column in a particular row in the parent table, it will trigger an automation, that will run this action (increase the count by 1 for all the referenced rows in the child table). I found everytime the bot runs successfully. The only thing is sometimes, when the automation is triggered, the updated count in the child table might not show immediately in the UI (editor), but after I refresh, it will contain the updated count. So I didn't find any issues for automation with referenced action using the example I had.
I think you are misunderstanding the issue.
@Rifad wrote:
I had an action that updates count + 1 parent row on changes made in child row.
Mentioned here is other way around. I created action in a bot on CHILD ROW that updates parent row update count+1.
You are doing it wrong. So an action i created directly by pressing Custom action button inside a bot was giving me errors as shown in the GIF. So I deleted that bot and created an action from behavior tab. Then created the bot and chose the action from dropdown.
I just created a bot on CHILD ROW that updates parent row's column to a certain value, it works fine for my app as well. I did that through the "custom action button inside a bot" as well, and there was no issue for my app. I know it might be inconvenient for you, but if you can share an app so that i can repro the issue, that would be great!
I have changed the setup because it was showing me this error. I might have to recheck with old version of same app.
@Lusha_Wang1 wrote:
I cannot repro the issue you were referencing to.
Please have a look at the GIF i shared. The behaviour is odd. It creates a row for that inline Item and show (1) then once background sync is completed it just disappears.
In the database a new row is added to child row. Parent ref is changing to a no existing ID in child row. I fixed it by creating same action from 'BEHAVIOR' Tab and then linking it to automation bot. Whenever I create an action directly from a bot it was having issues. I will post more bugs if I notice next time.
It would be great if you can share an app with me that I can repro the issue by myself.
Does the action use [_THISROW] in any of the expressions? We are investigating a known issue with some [_THISROW] references not resolving correctly for expressions written in the automation configuration. It might explain why the same action works when configured elsewhere. If you're using it as a shorthand for the current row key (as opposed to within a select filter), using the actual key column name instead should work around it. Or, as you found, configuring the action in the Actions tab instead.
or use [_thisrow].[Key] instead of [_thisrow] alone.....
@Adam-google Hope this bug is going to be fixed as soon as possible.
The fix is currently behind a feature gate, we will do more testing and then rollout slowly.
Hope it will be like "this" soonest..
Do you have any idea to make this work in BOT ? Its used in looping action. And it works perfectly in mobile. Does not work in BOT.
SELECT(
Product Bill of Materials[Product Bill of Materials ID],
AND(
[Default Supplier] = INDEX([_THISROW].[List of suppliers],([Purchase Order Add Count]+1)),
IN(
[Product Bill of Materials ID],
UNIQUE(
SELECT(Sales Order Acceptance Items[List of Bill of Materials],
[_THISROW].[Sales Order Acceptance ID] = [Sales Order Acceptance ID]
)
)
)
)
)
Not entirely sure if there is a gab between server/client side expression parser in terms of how to yields the result out of your expression.
In the meantime, I assume [List of Bill of Materials] column is List type. If so, it looks strange why this is working on the client side.
If [List of Bill of Materials] is Enumlist/List type then, the expression could be
SELECT(
Product Bill of Materials[Product Bill of Materials ID],
AND(
[Default Supplier] = INDEX([_THISROW].[List of suppliers],([Purchase Order Add Count]+1)),
IN(
[Product Bill of Materials ID],
UNIQUE(
SPLIT(TEXT(SELECT(Sales Order Acceptance Items[List of Bill of Materials],
[_THISROW].[Sales Order Acceptance ID] = [Sales Order Acceptance ID]
))," , ")
)
)
)
)
[List of Bill of Materials] is an ENUMLIST
No virtual columns or LIST type is used in above expression because in BOT it does not work.
@Koichi_Tsuji wrote:
gab between server/client side expression parser
Looks like there is some issues. I have also noticed List Ref virtual columns also does not fetch data.
For ex instead of [Purchase Order Add Count] if I use COUNT([Related purchase orders]) inline list then noticed it doesn’t work on bot.
Not user if its an intended behaviour. I again repeat same action works in editor UI always. Automation and Desktop UI is having same issues as far as I have noticed.
But I suppose this is no a case with @Rifad
What he did construct his bot is to run the data change action from child to parent. So he should be using List([Ref Column]) type of expression inside his app, but not with [_thisrow] syntax alone. I sninff something else is doing wrong.
You are right. But what he mentioned is different bug. Hope fixed both of them soon.
@Adam-google thanks but above mentioned is another bug related to automation that has a ticket open Case ID [1-8644000033964]. I reported for another issue here but somehow got merged with 2 issues together due to confusion and lack of details in support email. This ticket has all related details with screenshots and videos explained.
Hello @Adam-google this issue is still there. When I create actions directly on a BOT it looks like its not working. It showing in Automation monitor and Audit history for some reason. But the data is not changed in database.
@Rifad wrote:
Stop 🛑 Using automation bot to create ACTIONS inside a BOT. I had an action that updates count + 1 parent row on changes made in child row.
Instead do this
This time I used INPUT() to update a row in another table
This was created directly from a bot instead of connecting an existing action. When I reconnected the action to a newly created action. It worked fine. Looks like it might create soo many issues as it is showing success in Automation Monitor and Audit History.
You are absolutely right. I have faced a lot of problems due to using automation actions.A nice hint from you.
Dear @Rifad
Are you still facing this problem? I believe actions inside automation is quite nightmare.
I also face the same problem. Where direct action using Form Saved trigger run the action succesfully if i have some incremental updates on child, the automation bot did it wrong and won't add (+1) each time new record added.
@stephenrich wrote:
Are you still facing this problem? I believe actions inside automation is quite nightmare.
I’m not really sure what to do because reaching out to the support team is such a hassle. For the past year, I’ve just gotten into the habit of going to the 'behavior' tab to create actions instead of dealing with them.
Honestly, I don’t even think about clicking that button anymore. It feels like customer support isn’t even understanding of the issue, even though I reported it a while ago. I really hope they would have fixed it by now.
@stephenrich wrote:
I believe actions inside automation is quite nightmare.
You are correct! The team that implemented Automation was largely new to AppSheet and did not implement it consistently. There are substantial variations that require very careful considerations and testing.
User | Count |
---|---|
14 | |
11 | |
9 | |
7 | |
4 |