Could not get the sys_id of Catalog Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 01:31 AM
I have a sub-flow below that creates a catalog task and getting the sys_id of it
But it always return this error even though the task is clearly there
What I'm trying to achieve is to get the sys_id of all catalog tasks created to be queried after the loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 01:46 AM
// 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 02:19 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 10:55 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2025 01:36 AM - edited 01-24-2025 01:36 AM
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.
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