Workday Integration

Danilo9
Tera Expert

Hello SN Community,

 

Other departments were merged to a different company but still works for us. Because of this they are all disabled in workday hence when the Workday integration schedule job runs, It will disabled those users in ServiceNow as well but they still need access to SNOW. I need help to make an exception. I created a onBefore transform script but it didn't work

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
 
if (action == 'update' && source.u_department == 'BUSINESS OFFICE') {   // department name
        ignore = true;
    }

})(source, map, log, target);
 
Any help will be appreciated. Thanks in advance
1 ACCEPTED SOLUTION

shloke04
Kilo Patron

Hi @Danilo9 ,

 

I think you are on the right track and would recommend using an On Before Transform script as well. Only addition I would do to your logic is to make use of System Properties so that you do not have to add an OR condition every time within your script and in future you can maintain it easily rather than modifying the script every time.

 

Please use the On Before Transform script below:

Before using this please create a system property by navigating to "sys_properties.LIST" from application navigator and hit enter.

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	var getDept = gs.getProperty('Property Name');
	if(action == 'update'){
		if(source.u_department.indexOf(getDept)>-1){
			ignore=true;
		}
	}

})(source, map, log, target);

 

In case if the above script does not work, then do check on below factors:

1. Source attribute used in above script is correct

2. Are there any other On After Transform script running after your On Before?

3. Are there any other Transform map or a custom feature in place which might be doing an update?

4. Put some logs in above transform script and then try to debug and share result to help you further.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

View solution in original post

2 REPLIES 2

shloke04
Kilo Patron

Hi @Danilo9 ,

 

I think you are on the right track and would recommend using an On Before Transform script as well. Only addition I would do to your logic is to make use of System Properties so that you do not have to add an OR condition every time within your script and in future you can maintain it easily rather than modifying the script every time.

 

Please use the On Before Transform script below:

Before using this please create a system property by navigating to "sys_properties.LIST" from application navigator and hit enter.

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	var getDept = gs.getProperty('Property Name');
	if(action == 'update'){
		if(source.u_department.indexOf(getDept)>-1){
			ignore=true;
		}
	}

})(source, map, log, target);

 

In case if the above script does not work, then do check on below factors:

1. Source attribute used in above script is correct

2. Are there any other On After Transform script running after your On Before?

3. Are there any other Transform map or a custom feature in place which might be doing an update?

4. Put some logs in above transform script and then try to debug and share result to help you further.

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

I will try the transform script tonight. I actually found a way using flow but I will give this a shot. Thank you for sharing this