Script to clear all user's email

Tona26
Tera Contributor

Hi, I just have cloned our production instance into a dev instance but, we need to clear all the data that lives on the email field from all the users at the user table

 

How can we do that?

 

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Tona26 ,

 

You can make use of Data Management module which requires no scripting to update/delete record in servicenow.

 

Just go to ur user table apply proper filter which gives u the exact records for which u want to empty the email address field. Once done right click on any column n scroll down u should see data management option where u can select update all with preview.

 

Once u select that one data management record will be created with ur filter applied. You just need to add one field for email as email empty save it n execute it. All email addresses will disappear.

 

Benefit of using data management module. If u want to revert back changes u will be able to rollback by going into that record under data management module. This requires no scripting

 

Thanks,

Danish

 

View solution in original post

5 REPLIES 5

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Tona26 ,

 

You can make use of Data Management module which requires no scripting to update/delete record in servicenow.

 

Just go to ur user table apply proper filter which gives u the exact records for which u want to empty the email address field. Once done right click on any column n scroll down u should see data management option where u can select update all with preview.

 

Once u select that one data management record will be created with ur filter applied. You just need to add one field for email as email empty save it n execute it. All email addresses will disappear.

 

Benefit of using data management module. If u want to revert back changes u will be able to rollback by going into that record under data management module. This requires no scripting

 

Thanks,

Danish