Scheduled Event and Process can't match up

moezat
New Member

Hi,
I am new to the channel and quite new user for Appsheet. I am sorry if I used the incorrect terms or created the thread in the wrong place.

I would like to create a bot which would export a backup and then delete all the rows in a table (a log) every sunday. I have set up a process to delete the rows in that table. But this process asks for a table (canโ€™t choose the โ€œNoneโ€ option) in order to apply the โ€œdeleteโ€ action on. My scheduled event canโ€™t link to a table. So, I get the error like โ€œevent and process are incompatibleโ€.

I canโ€™t choose the ForEachRowInTable Option in Schedule event because it was running the export task x(numberofrowsinthelog).

Please help me figure out how to create a scheduled action to delete the rows in my table.

0 5 322
5 REPLIES 5

I would make 2 Bots. 1 to export the backup, and the 2nd to delete all the rows. The Event for the 2nd Bot you can choose the โ€œForEachRowInTableโ€ Option. Have the 2nd Bot run an hour or so after the 1st.

moezat
New Member

Thanks Marc for your help.
I guess thatโ€™s the only option I have although it is not very neat. (The 2nd Bot deleting the rows independently from the status of 1st Botโ€ฆ it could be fatal error if I messed up in future app maintenance.)

Could you explain a little more about your Bot that exports ? Trying to see if I can think of a way to do the delete in the same bot.

Hi Dan,
Thanks for your reply. Actually, I found out later that scheduled bots are only available after deployment. My app is still in beta stage. So, I made it work by having a manual button which adds a row with some โ€œkeywordโ€ which in turn would initiate a process listening to that keyword.

Ideally, what I would like to do with scheduled bots is, that โ€œevery Sundayโ€ I intend to back up all the records of a table, and then format the table to new (clean all the records in it). So, I like to export the records of this table to a templated xlsx file, and after this โ€œstepโ€ is done, next step is to clear all the records in it. If there was an error in backup step, the clearing step should not be performed this way.

However, if my understanding is correct, I canโ€™t attach a table to a scheduled event without turning on โ€œForEachRowInTableโ€ option. I need to export โ€œthe whole tableโ€ just one time, not โ€œfor each row in itโ€, but I need to clear every row in it.(not including header row of course)

I hope I explained myself well this time. Forgive me, if I made it confusing with wrong terms, again.

Hi @moezat,

This is what I would do.

Create a table that has one row in it, lets call it โ€œTriggerโ€

Create a Bot with a scheduled for each row event on the โ€œTriggerโ€ table.

Create a ref action step, Actions: The Essentials | AppSheet Help Center to copy all rows from your initial table to the backup.

Create a ref action step to delete all rows from the initial table.

If you want update the row in the trigger table indicating that the Bot ran successfully with a time stamp.

Hope this helps.

Top Labels in this Space