scheduled import job

chercm
Mega Sage

i am using a walkup experience user badge table and a sql server with badge numbers and facility number . i will be using scheduled import job to import the user badge details to the user_badge table in servicenow . 

 

But the badge information from the sql data is having xxxx:xxxx , how can i extract the number after the colon during the import process to be place into the badge column in the user_badge table ?

29 REPLIES 29

JenniferRah
Mega Sage

You would need to write a script in your transform map to convert it.

Ankur Bawiskar
Tera Patron
Tera Patron

@chercm 

you can handle this in your field map associated with your transform map

Use field map script and then manipulate string

answer = (function transformEntry(source) {

	var sourceValue = source.u_description; // give your source field name
	var myNumber = sourceValue.split(':')[1];
	return myNumber; // return the value to be put into the target field

})(source);

AnkurBawiskar_0-1741355483263.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar question, the source data on the SQL DB is having the facility code starting with 00xxxx but when using scheduled import job it became xxxx without the 00. how to ensure it is capturing the whole data ? 

@chercm 

so please determine which script is doing that manipulation.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader