Could not get the sys_id of Catalog Task

Gab
Tera Expert

I have a sub-flow below that creates a catalog task and getting the sys_id of it

Gab_0-1728894819260.png

But it always return this error even though the task is clearly there

Gab_1-1728894852646.png

What I'm trying to achieve is to get the sys_id of all catalog tasks created to be queried after the loop.

 

 

 

4 REPLIES 4

Shubham_Jain
Mega Sage
// Get the sys_id of the Catalog Task
var taskGR = new GlideRecord('sc_task');
taskGR.addQuery('number', 'SCTASK0001234');  // Replace with the actual Catalog Task number or other condition
taskGR.query();
if (taskGR.next()) {
    var catalogTaskSysId = taskGR.getValue('sys_id');
    // Set the sys_id as an output for further steps in the subflow
    outputs.catalogTaskSysId = catalogTaskSysId;
}

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


Najmuddin Mohd
Mega Sage

Hi @Gab ,

Can you try by setting the Task IDs variable from data pill picker itself.
Drill down to the sys_id of the catalog task in the right pane and drop it in the field. Add comma (,) and then drop the variable task_ids variable.

If the above information helps you, Kindly mark it as Helpful and Accept the solution.

Regards,
Najmuddin.

Hi @Najmuddin Mohd 

 

I can get the correct sys_id using the data pill picker.

 

But I did not understand what you mean here 


@Najmuddin Mohd wrote:.

Drill down to the sys_id of the catalog task in the right pane and drop it in the field. Add comma (,) and then drop the variable task_ids variable.


I need to get all the task sys_id in the loop to use it later.

Nen
Tera Guru

Hi Gab,

 

I've encountered this earlier. I was trying to concatenate different values including the Task sys_id on a script and I can't get it to work by using "fd_data._5__create_catalog_task.catalog_task.sys_id".

 

I was able to get the Task sys_id via data pill, so I created a flow variable, then I've assigned the value using the data pill.

Nen_0-1737711222618.png

Then on my script, I accessed the flow variable via "fd_data.flow_var.task1_sysid".

 

This worked for me but I'm not sure if this will be applicable to your requirement since you're working on a loop.

 

Regards,

Nen