Transform Maps Executions

Lucas Romani1
Tera Contributor

Hi,

 

I was studying about transform maps and import sets, and two questions popped into my head:

 

- Transform maps are executed only when we click on "Transform" related link UI Action on transform maps table OR the execution of transform maps can be associated to the "Set synchronous import set" and "Transform synchronously" business rules that exists by default on sys_import_set_row table ?

 

- Also, can we trigger a transform map execution by script ?

1 ACCEPTED SOLUTION

Anand Kumar P
Giga Patron
Giga Patron

Hi @Lucas Romani1,

1)Yes we can execute TM when click on Transform ui action 

2)When a new import set row is inserted in import set table the “Set synchronous import set” business rule sets the transform_map field, and the “Transform synchronously” business rule processes the transformation.
3. Scripting: Yes, you can trigger a transform map execution through scripting as well. You can use server-side scripts or business rules to execute a transform map programmatically when certain conditions are met. This gives you more flexibility in automating the transformation process.

Example code:

igr = your import set GlideRecord

transformMap = your transfrom map GlideRecord

var t = new GlideImportSetTransformerWorker(igr.sys_id, transformMap.sys_id);

 

  t.setProgressName("Transforming: " + igr.number + " using map " + transformMap.name);

  t.setBackground(true);

  t.start();

Please mark it helpful and solution proposed if it works for you.

Thanks,

Anand 

View solution in original post

2 REPLIES 2

Jaspal Singh
Mega Patron
Mega Patron

Hi Lucas,

- Transform maps are executed only when we click on "Transform" related link UI Action on transform maps table OR the execution of transform maps can be associated to the "Set synchronous import set" and "Transform synchronously" business rules that exists by default on sys_import_set_row table ?

Yes, you can control the behavior via the mentioned BRs.

 

- Also, can we trigger a transform map execution by script ?

You can using GlideImportSetLoader & GlideImportSetTransformer

https://developer.servicenow.com/dev.do#!/reference/api/utah/server/no-namespace/GlideImportSetTrans... 

https://www.servicenow.com/community/itsm-forum/glideimportsettransformerworker-and-glideimportsetlo... 

Anand Kumar P
Giga Patron
Giga Patron

Hi @Lucas Romani1,

1)Yes we can execute TM when click on Transform ui action 

2)When a new import set row is inserted in import set table the “Set synchronous import set” business rule sets the transform_map field, and the “Transform synchronously” business rule processes the transformation.
3. Scripting: Yes, you can trigger a transform map execution through scripting as well. You can use server-side scripts or business rules to execute a transform map programmatically when certain conditions are met. This gives you more flexibility in automating the transformation process.

Example code:

igr = your import set GlideRecord

transformMap = your transfrom map GlideRecord

var t = new GlideImportSetTransformerWorker(igr.sys_id, transformMap.sys_id);

 

  t.setProgressName("Transforming: " + igr.number + " using map " + transformMap.name);

  t.setBackground(true);

  t.start();

Please mark it helpful and solution proposed if it works for you.

Thanks,

Anand