I need a help from this esteemed community for creation of bot and action for it.
I have table called Users and it has a [email id] as one of the column and [user name] is the key column for users table . I have another table called filter dashboard which has [email id] as key.
Note: [Filter id] in the filter dashboard table has email address. so I have mentioned in the above para as [Email]
Need : When a user is deleted from the user table, email id and its entire row should be deleted from filter dashboard table also.
I don’t know how to create an appropriate action and to configure the bot.
Please hide the 'Delete" system action by enabling “Do not display” option on the Users table. Also make this action’s "Needs confirmation setting off.
Please create a reference action (type : execute an action on a set of rows) called say “Filtered Dashboard User Delete” on the Users table with settings as
D. Referenced action : 'Delete" ( Select “Delete” system action of the “Filtered Dashboard” table.
3/ Create a grouped action on the Users table called “Master Delete” with suitable prominence as you want.
A. In this group action select “Filtered Dashboard User Delete” created in step 2 above as first action.
B. Select the “Delete” system action on the table Users as second group action.
Now when the user executes the action “Master Delete” created in step 4, first the record from the “Filtered Dashboard” will delete, followed by the record from the Users table.
Can you elaborate what you mean by this? If you mean adding a record to the “Filtered Dasboard” table when a user is added to the User’s table, you could try an action type " Add a new row to another table using the values from this row" as an event action in the Users table’ s form save event.
Another way to simplify this could be to have “Filtered Dashboard” record as child record of the User’s table with “Is Part of” setting enabled in the reference column. Then whenever the User deletes the User table record , the child 'Filtered Dashboard" record will also be automatically deleted. In that case all these manually constructed actions are not required.
Another way to evaluate the requirement is , is the “Filtered Dashboard” table really required? Could you have those columns of user choices in the Users table itself? Any specific reason you have those two different tables?
This Filter dashboard table is to generate user filtered PDF. This table helps to extract records from another table and it will be fed to PDF Report generation.
Would it be just easier to use the Bot as in your original post? Then you can set the trigger as Deletes_Only. The Referenced rows could have a formula as LIST([Email ID]). That should be enough to find the correct row.
There is nothing wrong with the apporach Suvrutt proposed.
The LIST([Email ID]) reads the value from the record you just deleted and it converts it as a list. Because it only have one value, it finds that row from your other table and then that will be delete as well.
@jaichith : The reference rows expression proposed by Aleksi is a smarter way of getting the referenced rows. In your case there is only 1-1 relationship between two tables. So an expensive SELECT() is unnecessary, even though it sound a familiar format.
You said in the beginning “I have table called Users and it has a [email id] as one of the column”. You need to use that column with this LIST() that contains the value that is possible to find from the other table’s key column. If it’s not, the Bot won’t do anything as it doesn’t find any rows.
Firstly, I have tried with the Action method insisted by @Suvrutt_Gurjar . I have changed the select expression with List ([Email]). It didn’t work.
Secondly, I have tried the action by attaching it to the bot. Even that also didn’t work.
Dear @AleksiAlkio and @Suvrutt_Gurjar can you please test this method at your end and convey about the viability to me because I have followed the instructions given by both of you but still efforts didn’t get success.
Just to assure you, I always test before suggesting any substantial solution. Otherwise those steps cannot be listed so much in detail.
As for Aleksi, please note that he is one of the senior most AppSheet experts and we keep learning many tips from from him. His solutions are always very practical.
Here are the screenshots o my testing before suggesting you.