Automation does not work properly when using Google Calendar as a data source vol.2

In fact, I posted the same information as this case last month.
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/Automation-does-not-work-properly-when-using-Go...

Additionally, I have contacted support about this.
ID 4-9428000036464

However, the problem has not yet been solved. (It was within our expectations...)
There is a workaround, so it is not urgent, but I am wondering.

Specify Google Calendar as the data source.
The data settings were left at their defaults with nothing changed.

1.png
2.png
Create the bot shown below.
This bot rewrites the value of Discription.
3.png4.png
When I add a record, the BOT gets the following error.
And the bot cannot set value to [Description].
5.png6.png
7.png
8.png
However, when editing, the Bot works without any problems and can Set value to [Description].
10.png
11.png

In this post, I would like to know if anyone else is experiencing the same phenomenon.
Is anyone else experiencing the same phenomenon as this post?

 

Solved Solved
0 2 192
1 ACCEPTED SOLUTION

First, I am not clear why you need a bot to update the Description.   When you have integrated Google Calendar, as it looks like you have, using the ADD button will automatically add the event to the Google Calendar.  When a row is edited and then saved that ALSO is automatically update in Google Calendar.  It is actually quite fast.  By the time I navigate to Google Calendar, the add and/or any updates are already there!
See below for my test event in Google Calendar.


In case I am missing something,  I suspect the issue you are facing is one of timing.  When you ADD a row, AppSheet knows about it immediately and can run Bots based on the added row BUT the Google Calendar service may not yet know about the row PLUS the underlying datasets based on Google Calendar service may not have had a chance to update with the new row.  In other words, shen the AppSheet Bot tries to locate the new row, it is not yet available to apply an update.

To test this, create a dedicated Bot for row adds and add a Wait step as the very first step. This will give time for all underlying datasets to be updated.  I DO NOT advocate using waits as a permanent fix - unless absolutely necessary. 

I hope this helps!

My test Calendar event as viewed from Google.  The Description was added when the row was added,  Then updated with UPPERCASE text.  Both originated from form saves in AppSheet.

Screenshot 2024-11-24 at 5.02.05 PM.png


View solution in original post

2 REPLIES 2

First, I am not clear why you need a bot to update the Description.   When you have integrated Google Calendar, as it looks like you have, using the ADD button will automatically add the event to the Google Calendar.  When a row is edited and then saved that ALSO is automatically update in Google Calendar.  It is actually quite fast.  By the time I navigate to Google Calendar, the add and/or any updates are already there!
See below for my test event in Google Calendar.


In case I am missing something,  I suspect the issue you are facing is one of timing.  When you ADD a row, AppSheet knows about it immediately and can run Bots based on the added row BUT the Google Calendar service may not yet know about the row PLUS the underlying datasets based on Google Calendar service may not have had a chance to update with the new row.  In other words, shen the AppSheet Bot tries to locate the new row, it is not yet available to apply an update.

To test this, create a dedicated Bot for row adds and add a Wait step as the very first step. This will give time for all underlying datasets to be updated.  I DO NOT advocate using waits as a permanent fix - unless absolutely necessary. 

I hope this helps!

My test Calendar event as viewed from Google.  The Description was added when the row was added,  Then updated with UPPERCASE text.  Both originated from form saves in AppSheet.

Screenshot 2024-11-24 at 5.02.05 PM.png


Thank you for this very clear explanation.


@WillowMobileSys wrote:

First, I am not clear why you need a bot to update the Description. 


I will explain the reason..
In the app that actually tried to implement this, the bot needed to change the value entered in the form for [Location], not [Description].

As you know, [Location] is an address type.
In addition to the “Google Calendar” table, the application has a “Customer” table, whose data contains [Company Name] and [Address].
Now, if I enter the following expression in the Suggested values of the Google Calendar table.

 

Customer[Address]

 

When filling out the form, the [Address] of the “Customer” Table is suggested in the list.
However, this is not very useful, as few people remember the exact address of their customers.
Therefore, I changed this Suggested values to the following expression.

 

Customer[Company Name]

 

This way, when filling out the form, a list of “company names” will appear instead of “addresses”.
Now there is no more confusion when users fill out the form.
After that, I need to convert this [Company Name] to [Address].
So, I set the following expression for [Location] in Automaiton's “Set row values”.

 

LOOKUP([_THISROW].[Location], "Customer", "Company Name", "Address")

 

If I are using a spreadsheet as my data source instead of Google Calendar, I know there are many other ways to do this,
In the case of Google Calendar, I had to use this method because of the limited number of actual columns available.

By the way, my own workaround is shown below.
The problem was solved by creating an action with “Set the values ...” in Action and calling it with “Run action on rows” in Automaiton, instead of “Set row values” in Automaiton.


@WillowMobileSys wrote:

In other words, shen the AppSheet Bot tries to locate the new row, it is not yet available to apply an update.


When the “Wait” step was added to Automaiton, it was executed successfully.
From this, I still surmise that this case is a matter of timing.

Thank you very much for your instruction!

Top Labels in this Space