Automation update value base on real time date

Hi Experts

Is there a feature in appsheet automation to update CAL CODE column to 3.1 base on the CALIBRATION TRIGGER ALERT DATE base on today date?

desmond_lee_0-1692429238765.png

 

Solved Solved
0 24 677
2 ACCEPTED SOLUTIONS

If you don't have a lot of rows, you can also use a combination of Bot & action and use the "For each row in table".

View solution in original post

Your bots setting could be something like below.

Please set the Time Zone and bot schedule time as you want for the daily bot.

In place of Table setting , please add the table name you have.

In place of Filter condition , please add the slice expression you referred above or whatever different you desire. I have not exactly understood what records you need to select in the slice for changing [CAL Code]

AND(
DATE([CALIBRATION TRIGGER ALERT DATE]) <=TODAY(),
[CAL CODE]<>13.2
)

 

Suvrutt_Gurjar_0-1692439270756.png

Your bot step could look something like below.

Set the value of [CAL CODE] as you wish.

Bot Action.png

 

View solution in original post

24 REPLIES 24

Yes, you could run a daily scheduled bot to change the value of records where "CALIBRATION TRIGGER ALERT DATE" matches' todays date.

You could create a slice on the table with a filter expression something like [CALIBRATION TRIGGER ALERT DATE] =TODAY(). You could then run that bot webhook on the records on the slice.

Please note the app needs to be in the deployed state to run the scheduled bots.

wow how come I can't think of that. Let me try. Thank you so much

Any example to use webhook? I never use that before

Please go through the following articles.

Introduction to webhooks - AppSheet Help

Manage apps using the AppSheet API - AppSheet Help

Update records in a table - AppSheet Help

Your webhook's http body will look something like below

{
"Action": "Edit",
"Properties": {
"Locale": "en-US",
"Location": "47.623098, -122.330184",
"Timezone": "Pacific Standard Time",
"RunAsUserEmail": "abcd@gmail.com"
},
"Rows": [
<<Start: SELECT(Todays Records Slice[Table Key], TRUE)>>
{
"Table Key": "<<[Table key]>>",
"CAL CODE":     3.1

},
<<END>>
]
}

You will need to change the highlighted fields as per your locale and slice name and table key name etc.

What is the meaning of below? Is this mandatory?

"RunAsUserEmail": "abcd@gmail.com"

Suvrutt_Gurjar_0-1692434386466.png

No it is not. Please read:

Invoke the API - AppSheet Help

 

If you don't have a lot of rows, you can also use a combination of Bot & action and use the "For each row in table".

Yes, correct, for a handful of rows , action option with bot will be simpler.

True. I am thinking of that too. In fact I have done one similar to this just submit form and update column value. But in this case is a time base situation and this is the first time I do timebase automation. I need to understand properly. The slice I have completed and the slice is related to AlekSiaLkio CALIBRATION CONCLUSION="FAIL". And this FAIL is send to the current table we dicusss as code 13.2. I manage to filter that off. If you see source table row role 536 is filter in the slice. 13.2 code mean FAIL and they need to be removed in the process of list over over duel tool under the code 13.1. This is the slice expression AND(
DATE([CALIBRATION TRIGGER ALERT DATE]) <=TODAY(),
[CAL CODE]<>13.2
)

desmond_lee_0-1692437822795.png

Slice

desmond_lee_1-1692437962630.png

 

 

Your bots setting could be something like below.

Please set the Time Zone and bot schedule time as you want for the daily bot.

In place of Table setting , please add the table name you have.

In place of Filter condition , please add the slice expression you referred above or whatever different you desire. I have not exactly understood what records you need to select in the slice for changing [CAL Code]

AND(
DATE([CALIBRATION TRIGGER ALERT DATE]) <=TODAY(),
[CAL CODE]<>13.2
)

 

Suvrutt_Gurjar_0-1692439270756.png

Your bot step could look something like below.

Set the value of [CAL CODE] as you wish.

Bot Action.png

 

Wow thank you soooooo much. You are so helpful

Both, Suvrutt Gurjar &  AleksiAlkio..... Than you both sooooo much. I pick the simpler direct Action and Bots method. I have 3,732 rows currently and this row will increase slowly. This is not an active database and probably increase 5-10 rows in 2 weeks. I pick 1am as my firing time because 1am the whole company is shutdown. I also change the filter expression. The expression written by me does not include those blank column. To the expression this is TRUE but to me its not true because 3,732 tools not every one of them need calibratrion. CAL CODE 13.2 is what I told AleksiAlkio in the easier post. CALIBRATION CONCLUSION='FAIL' is translated as a code to this database. 13.1 a code for overdue calibration date. 13.1 is to filtered the user from scanning tool bar code and 13.2 is to backfalsh tool to scrap system.  This is the expression 

AND(
ISNOTBLANK([CALIBRATION TRIGGER ALERT DATE]),
DATE([CALIBRATION TRIGGER ALERT DATE]) <=TODAY(),
[CAL CODE]<>13.2
)

I don't even need a slice !

desmond_lee_0-1692510794647.pngdesmond_lee_1-1692510829405.pngdesmond_lee_2-1692510848809.png

desmond_lee_3-1692512220202.png

 

 

 

 

  1. Is the bot working ?
  2. If so, are you looking for help with filter expression?
  3. If so, could you state your requirement for bot filter in plain English?
  4. Also earlier you stated slice with [CALIBRATION TRIGGER ALERT DATE]= TODAY() but in bot filter you are using  [CALIBRATION TRIGGER ALERT DATE]<= TODAY() 
  5. Finally if  [CALIBRATION TRIGGER ALERT DATE] is date type column, you do not need to further wrap with DATE as you have done DATE([CALIBRATION TRIGGER ALERT DATE]). You can simply use 

         [CALIBRATION TRIGGER ALERT DATE] <=TODAY()

The bot is working

I don't need a slice

[CALIBRATION TRIGGER ALERT DATE]<= TODAY() - This is what I am looking for.

[CALIBRATION TRIGGER ALERT DATE] is a Datetime type so I warp it to Date without time


@desmond_lee wrote:

[CALIBRATION TRIGGER ALERT DATE] is a Datetime type so I warp it to Date without time


Okay, that is correct.


@desmond_lee wrote:

The bot is working


 

Great.


@desmond_lee wrote:

I don't need a slice


Yes, sorry it was a typo, I mean bot filter. I have corrected the typo in original post

 


@desmond_lee wrote:

[CALIBRATION TRIGGER ALERT DATE]<= TODAY() - This is what I am looking for.


Could you update what help you are looking for? 

 

Thank you again

One thing to remember.. if the Bot has a lot of rows to check, it can take more than the limit, which is 5 minutes for scheduled Bots and 2 for data change Bots. Then the slice is a good approach to limit those rows.

So do I change to slice method? Of course I already have that slice ready now. Because those blank no calibration is 80% thus basically I only need 20% to be process in this bot. I think its a waste

You can check the need how quickly the Bot process it. If it's a quick, then there is no need. I just wrote it as a reminder 

Mind to tell me where to look for this speed? So sorry I am really not good in bots and all these is my first time doing it. Thank you again

Either from the Automation monitor or directly from your gSheet how quickly they are updated when the Bot is triggered for example manually.

Just I use my watch its less than a minute

Using less resources is always a better option.

Agreed thank you again. There another post about delete row see if you have any ide

Top Labels in this Space