Deleting multiple records UI Builder
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 07:54 AM
Hi.
I have a user case where I want to delete multiple records from a table. I want to make use of the "Delete multiple records" data resource.
I execute the data resource in a client script as following:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2024 11:53 PM
You are going through these steps to delete one record? Just delete the record.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 07:17 AM
There could be cases where there are more then 1 record with them same email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 12:35 AM
If it's a recurring thing, make a fix script for it:
var data = new GlideRecord('x_1390311_easy_r_0_ignorings');
data.addEncodedQuery('email=robot@gmail.com');
data.query();
while(data.next()){
data.deleteMulitple();
}
Or consider using a before business rule: if email = robot@gmail.com, abort action.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2024 01:15 AM
Hi @NizamArif ,
Please check below solution
Please add a data resource Delete Multiple Records
Add one client script and attach that client script on any button or something you want to add
/**
* @param {params} params
* @param {api} params.api
* @param {any} params.event
* @param {any} params.imports
* @param {ApiHelpers} params.helpers
*/
function handler({api, event, helpers, imports}) {
api.data.delete_multiple_records_1.execute({
'table': 'x_1390311_easy_r_0_ignorings', // Your Table
'encodedQuery': 'email=robot@gmail.com' // Your Query
});
}
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak