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

@chercm 

if you are sure which character is that, copy from that source field value and split using that

OR

simply if you are sure the colon will appear after 5 characters then use substring like this but please enhance

var str = '00235:04280';

var substringval = str.substring(6,11);

gs.info(substringval);

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

Medi C
Giga Sage

Hi @chercm
If the field on the staging table or target table is a numeric one, the leading 0s would not be captured. Please confirm if you are using string fields in both tables.


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Hi @chercm 
I hope you are doing well. Did it work for you?


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

Medi C
Giga Sage

@chercm 

Are you using a SQL statement for your data import?


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

@Medi C is there any other method ?