Generating file of deleted rows

In my app I have a table called "Master Sheet". Users can delete rows from this table. 

I want to manage this process better so that if any user deletes a record. I am able to know what the record was that was deleted.

I am trying to create a file everyday (using BOTS) that is generated every day using bots that lists all the deleted rows. I am generating a file because I want to look at daily/weekly data and don't want notification/email for every delete individually. 

To do this I found this link related to appsheet which I have modified to meet my requirements. I am entering the following in the "Condition" field of the Event with event type as "Data Change"

AND(
  ("" = [_THISROW_AFTER].[Key]),
  ([_THISROW_AFTER].[Key] <> [_THISROW_BEFORE].[Key])
)

The problem is that it will generate a file for each delete while I want to collate all deletes done for say a day in the file. How to achieve that?

Solved Solved
0 4 137
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Nishit 

I did not test such use case, but what about:

1) one bot to keep track of your deleted data:

Aurelien_0-1662976266929.png

With a data action that will have expressions such as:

 

 [_THISROW_BEFORE].[yourColumnToKeepTrackOf]

 

So you make a copy of your deleted data in another table.

2) one bot to run a report on a daily/Weekly period, on this copy_table:

Aurelien_1-1662976375360.png

 

View solution in original post

4 REPLIES 4

Aurelien
Google Developer Expert
Google Developer Expert

Hi @Nishit 

I did not test such use case, but what about:

1) one bot to keep track of your deleted data:

Aurelien_0-1662976266929.png

With a data action that will have expressions such as:

 

 [_THISROW_BEFORE].[yourColumnToKeepTrackOf]

 

So you make a copy of your deleted data in another table.

2) one bot to run a report on a daily/Weekly period, on this copy_table:

Aurelien_1-1662976375360.png

 

Thanks for the quick response @Aurelien 

Making a copy itself is the challenge here, right?


So you make a copy of your deleted data in another table.

Also post step 1,  the tasks that are available based on the trigger no one of them are conducive to adding the row to a table

Nishit_0-1662977662077.png

 

Automation is kind of messy.
The "Step" lets you select what you want to do, in this case it's an action


Steps: The Essentials - AppSheet Help

For anyone having the same problem. Here's I was able to solve for basis @Aurelien's recommendation

  1. Create a new empty table where you wanted the deleted FAQ
  2. Create a new bot 
  3. Set 'Event' trigger as "Data Change" and "Deletes only"
  4. Create a new process with action as "Run a data action" Nishit_0-1663050005788.png

     

  5. Populate the column of new table with 
    [_THISROW_BEFORE].[yourColumnToKeepTrackOf]​
    Nishit_1-1663050195653.png

     

Top Labels in this Space