Hi @Jake Adams ,

 

Please try the below code in onAfter transform script:

 

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

    var gr = new GlideRecord('table_name'); //table_name is my custom table name
    gr.addEncodedQuery("cmdb_ci.operational_status = 1");
    gr.query();
    while (gr.next()) {
        var taskCR = new GlideRecord('task_ci');
        taskCR.initialize();
        taskCR.task = target.sys_id;
        taskCR.ci_item = gr.u_configuration_item;
        taskCR.insert();
    }

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

 

 

Please mark this response as correct or helpful if it assisted you with your question.

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.