- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 12:42 PM
I need to bulk remove values in a field that I populated using an import set. Is there sample code to run a script (fixed script) to remove all values in a field called u_securty_contact? On the customer_account table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 01:15 PM
You can use something like
var gr = new GlideRecord('customer_account');
gr.addQuery(<query to identify you created via import set>);
gr.addQuery('u_security_contactISNOTEMPTY');
gr.query();
while (gr.next()) {
gr.u_security_contact = '';
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 01:10 PM
Unless you have a common identifier, e.g. field starts with "UPLOAD" you could use an addQuery(), find the values and clear them, otherwise a quick and dirty way would be just to find all records updated at that septic time and remove the values in bulk via the list editor... Obviously the longer you leave it the harder it will be to track down.
Please mark as helpful or if it resolved the issue CORRECT!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 01:15 PM
You can use something like
var gr = new GlideRecord('customer_account');
gr.addQuery(<query to identify you created via import set>);
gr.addQuery('u_security_contactISNOTEMPTY');
gr.query();
while (gr.next()) {
gr.u_security_contact = '';
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2023 02:48 PM - edited ‎06-29-2023 02:54 PM
Hi!
I'm getting a parsing error on line 2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2023 07:07 AM
That was an example i put up . You need to add a query to identify records which are created via your import set. Is there any identifier?