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 

so what came in log after the split? did you debug?

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  it is coming as 002351234  as the badge number . it seems that it is not taking the colon properly. from the db under badge_number column is having facility code : badge number format. can i just break that informatiion into the facility code and badge number ?

@chercm 

try avoiding split keyword as variable

use some other and did you print what's present in the source field value and what's the value just before setting it?

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

from the source  ;

 

Facility code : 00235

badge number: 00235:04280

 

After the import it becomes this on the SN table 

facility code : 235

badge number : 0023504280

 

@chercm 

it depends on what your target field is for facility code. If it's integer it will consider 00235 as 235

did the logic not work for badge number? did you use some other variable name instead of split here

AnkurBawiskar_0-1741598580154.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