How to call a script include from transform map script?

Suyash Joshi
Tera Contributor

Hello All,

I am stuck in a  situation in which I need to call a script include in Transform map script?

(*Cannot share anything via confidential !! Hope all of you understand).

Any Help will he appreciate.

Regards,

Suyash

1 ACCEPTED SOLUTION

@Suyash Joshi Here is how the script include can be used in on before script. Convert this script based on your context.

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
	var oidcTransformCheck = new OIDCTransformCheck(source, map, log, target);
	var isMappingValid = oidcTransformCheck.validateMappingOnBefore();
	if(!isMappingValid) {
		ignore = true;
	}
})(source, map, log, target);

 

View solution in original post

4 REPLIES 4

Sandeep Rajput
Tera Patron
Tera Patron

@Suyash Joshi Since the Transform map script runs at the server side, you can simply call the script include as follows.

 

var utils = new HRUtils(); //Replace with your script Include name
var glideTask = utils.getTaskRecord();//Replace with your method name which you would like to call.

Hope this helps.

I have made script include in that script include there is input of html in that html three links I made pattern and replace with my desire need , now i have one table there is one field that field type is html type now I have made excel sheet there is for that target table field there is html paragraph now i make data source and transform map in transform map i need to write script on before , now how i call script include that change my target table paragraph ex my script include name is regexwork and function name is demo.

Can you help reach my requirement.

Kind regards,

Suyash

@Suyash Joshi Here is how the script include can be used in on before script. Convert this script based on your context.

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
	var oidcTransformCheck = new OIDCTransformCheck(source, map, log, target);
	var isMappingValid = oidcTransformCheck.validateMappingOnBefore();
	if(!isMappingValid) {
		ignore = true;
	}
})(source, map, log, target);

 

Hi @Suyash Joshi ,

var scriptInc = new regexwork().demo(source.field_name);
if (scriptInc) {
    current.target_html_field = scriptInc;
}

Thanks,

Anand