How to import data from excel sheet to a table on servicenow

Souvick A
Tera Contributor

Hello All,

I have an excel sheet where I have phone numbers which I need to update on the sys_user table business phone field.

I need to update only the users whose business phone field in blank with the phone numbers from excel sheet matching against their user id. 

I need to know the whole process to import the data in sys_user table.

Thanks in Advance

 

Regards

Souvick 

1 ACCEPTED SOLUTION

AnveshKumar M
Tera Sage
Tera Sage

Hi @Souvick A ,

What field you have in excel to identify the user? Is it email, user_name or something else?

 

You can use Load data module with transform maps to import this data.

1. Load data: Navigate to System Import Sets -> Load data

AnveshKumarM_0-1695893174079.png

 

2. Sample Data

AnveshKumarM_1-1695893338219.png

 

3. Fill in the details as shown below and select your excel file then click submit.

AnveshKumarM_2-1695893366861.png

4. You will get the following page, then select create transform map.

AnveshKumarM_3-1695893431932.png

 

5. You will get the following page, fill in the data as shown then save (not submit).

AnveshKumarM_4-1695893641359.png

 

6. Once the form is saved, in the related links section click on Mapping Assist and in the page opened map the fields from excel to fields in user table as shown below and save.

AnveshKumarM_5-1695893840510.png

7. Then open the email mapping record from the Field Map  related list and in the page opened, enable the Coalsce check box to true and click on update.

 

AnveshKumarM_6-1695893950661.png

8. In the Transform map page set the Run Script  check box to true and use the code below in the Script field and save.

(function transformRow(source, target, map, log, isUpdate) {
    
	if(!isUpdate){
		ignore = true;
	}

	if (target.phone == '') {
        ignore = true;
    }


})(source, target, map, log, action === "update");

AnveshKumarM_7-1695894242620.png

 

9. Now from the transform map related links page click on transform and in the page opened select the import set (that you loaded in the first two steps) and select the transform which we created now (auto selected) and click on Transform.

AnveshKumarM_8-1695894338377.png

10. Now check your user records after the transform is completed.

AnveshKumarM_9-1695894426184.png

 

 

Please mark my answer helpful and accept as solution if it helped you 👍✔️

 

 

 

 

Thanks,
Anvesh

View solution in original post

5 REPLIES 5

@Souvick A I'm glad this helped 😀

Thanks,
Anvesh